Description
Easily filter eloquent models using arrays - great for filtering from http requests.
class Product extends Model implements IsFilterable{ use Filterable; public function allowedFilters(): AllowedFilterList { return Filter::only( Filter::field('name', [FilterType::EQUAL]), ); }} $products = Product::filter([ [ 'target' => 'name', 'type' => '$eq', 'value' => 'TV' ]])->get();
Recent Courses on Laravel Daily
Practical Laravel Security: Packages, Secrets, Supply-Chain Attacks
7 lessons
43 min read
Roles and Permissions in Laravel 13
14 lessons
57 min
Laravel 13 Eloquent: Expert Level
41 lessons
1 h 34 min