Laravel filter : build your own custom filter (do it without packages) #freepalestine

preview_player
Показать описание
Laravel custom filter in 5 mins #freepalestine
Рекомендации по теме
Комментарии
Автор

Awesome. I believe this is just to show how to build a generic filter only. You can make it more verbose but great work to show how to build a generic filter in laravel.

ripplesr
Автор

I would make filterable as a method so that you can also use request()->user()->isAdmin or something like that, for example.

I always implement such methods in the controllers.

A scope where request is passed would also be an alternative. This could then also be used in the models and set as default filterable() { return $this->fillable; } in the trait.

MuetzeOfficial
Автор

looks good
try to use more OOP to improve it didn't use trait

AbedAbugozah
Автор

Great! But you have to make sure that $filterable should be implemented too.
And also, it is not too flexible as sometimes you only need a certain column to filter only or it will not be a very optimized query.
Keep it up!

bboydarknesz
Автор

Walaikum as-salam wa rahmatullahi wa barakahtuhu.

#freepalestine #GazaGenoside

minhazulislam
Автор

Can you combine scopeFilter and scopeSearch to work as one thing ma dear brother?

samahnation
Автор

what extension did you use to show the errors in vscode?

kirayamato
join shbcf.ru