🌟 Laravel Query Builder v7: a must-have package for building APIs in Laravel
https://freek.dev/3052-laravel-query-builder-v7-a-must-have-package-for-building-apis-in-laravel
#php #laravel #package #spatie #PHP
Laravel Query Builder v7: a must-have package for building APIs in Laravel | freek.dev

We just released v7 of laravel-query-builder, our package that makes it easy to build flexible API endpoints. If you're building an API with Laravel, you'll almost certainly need to let consumers filter results, sort them, include relationships and select specific fields. Writing that logic by hand for every endpoint gets repetitive fast, and it's easy to accidentally expose columns or relationships you didn't intend to. Our query builder takes care of all of that. It reads query parameters from the URL, translates them into the right Eloquent queries, and makes sure only the things you've explicitly allowed can be queried. // GET /users?filter[name]=John&include=posts&sort=-created_at $users = QueryBuilder::for(User::class) ->allowedFilters('name') ->allowedIncludes('posts') ->allowedSorts('created_at') ->get(); // select * from users where name = 'John' order by created_at desc This major version requires PHP 8.3+ and Laravel 12 or higher, and brings a cleaner API along with some features we've been wanting to add for a while. Let me walk you through how the package works and what's new.

freek.dev
🌟 Laravel Backup v10: serializable events, resilient multi-destination backups, and more
https://freek.dev/3015-laravel-backup-v10-serializable-events-resilient-multi-destination-backups-and-more
#php #laravel #package #spatie #backups
Laravel Backup v10: serializable events, resilient multi-destination backups, and more | freek.dev

We just released v10 of laravel-backup, our package that creates backups of your Laravel app. The backup is a zip file containing all files in the directories you specify, along with a dump of your database. You can store it on any of the filesystems Laravel supports, and you can even back up to…

freek.dev
A clean API for reading PHP attributes | freek.dev

PHP 8.0 introduced attributes, and they're a great way to add structured metadata to classes, methods, properties, constants, and parameters. The concept is solid, but the reflection API you need to actually read them is surprisingly verbose. What should be a simple one-liner ends up being multiple lines of boilerplate every time. And if you want to find all usages of an attribute across an entire class, you're looking at deeply nested loops. We just released spatie/php-attribute-reader, a package that gives you a clean, static API for all of that. Let me walk you through what it can do.

freek.dev

Een #spatie maakt het verschil:

"Ik leg de schuld bij de genen die jouw handicap hebben veroorzaakt" versus "Ik leg de schuld bij degenen die jouw handicap hebben veroorzaakt"

#spatiegebruik

New #PHP Console brings #Laravel Web Tinker to #Chrome DevTools Panel πŸ› οΈ

#Chrome Extension brings #PHP console to DevTools by integrating #Spatie #Laravel Web #Tinker package. Direct access from browser panel for seamless #coding and debugging. https://github.com/tnylea/php-ext

GitHub - tnylea/php-ext: A chrome extension to show PHP (Laravel) devtools console

A chrome extension to show PHP (Laravel) devtools console - tnylea/php-ext

GitHub

#Spatie (30% off) - Daily deals on packages, components & courses

πŸ’» Specialized Learning Resources:
#CloudCasts (40% off) - Focused #AWS training for developers
#DevDojo (40% off) - Premium developer tools and training bundle

#laravel make #user with roles (with #spatie/permissions) #console
De #spatie maakt het verschil. Komop #nos, beetje opletten.
#spatiefouten #nederlands
Anyone used #Spatie #medialibrary? Have I missed a toHtml type function (using the view) which falls back if the conversion doesn't exist or do I have to write my own? I can't believe wanting to do this is unique. #Laravel #php

Common phrases you hear as a Laravel dev.

"Spatie has a package for that."

#spatie #laravel #php