Laravel BelongsToMany Filter: With/Without Spatie Query Builder

preview_player
Показать описание
Answering a public tweet with the situation about filtering the records.

Resources mentioned in the video:

- - - - -
Support the channel by checking out my products:

- - - - -
Other places to follow:
Рекомендации по теме
Комментарии
Автор

Main question here is, what is faster? Does the first or second example use more queries?
The second example is waaaay more readable but if its less efficient..

bremg
Автор

It would he nice to use $request->filled instead of $request->has
Because under the hood laravel will check whether this input is available in request and it has some value
$request->has only checks either input is available in request or not

FaizanAmin_Faizi
Автор

Quick question. Do you have any tutorial on doing this filtering using form in laravel blade?

digitaluniverse
Автор

Spatie - laravel query builder package that you showed in video is looks like mostly filtering based on the request, is there any package or alternative that you would suggest if those filters are not based on request?

chhirag
Автор

Ничего не понял, но очень интересно))

deenkag
Автор

How to filter items from location name using QueryBuilder

aryaherro
Автор

Hmm QueryBuilder loads all of the relations we passed despite that we used only a single filter. What if there are tens of relations out there, that might be a huge performance issue. What do you think?

valentinvalev
Автор

I have almost same task
But I have 2 databases and connected them with setConnetion + BelongsTo

Everything comming perfect but Where is not working

Every time I try withWhereHas showing
Undefined table: 7 ERROR: relation TABLENAME does not exist

Can you help me to solve this sir?

husniddintogizov
Автор

Hello sir, can you please provide me the scripts of filtering from ten or more tables where each of three tables joined with foreign keys. ??

evanansh
Автор

Don’t understand anything 😅 need time to learn it . Thank you

alexShk