Laravel Queries: Group AND-OR Conditions to Avoid Errors

preview_player
Показать описание
If you have a complex DB query with multiple AND/OR conditions, there's one mistake you need to avoid. In this video, I will show you what the mistake is, what is the bad result of it, and how to fix it.

Support the channel by using one of these:
Рекомендации по теме
Комментарии
Автор

I dont know why, but I watch all of your videos. I think it is because these go straight to the point and are informative. Keep going...

JohnnyBigodes
Автор

Hi, I really like the way you explain the laravel concepts and implementation. Thank you so much! Could you include some videos like joining multiple tables in a database, what all are the possible errors, and so on? It would be of great help!

johangeorge
Автор

You can also use $query->dd(); instead of dd($query->toSql());

JaimeNetoBr
Автор

OMG Thank you so much!!! Literally had the exact same mistake!!!

cutiex
Автор

thank you so much i was searching this for so long ❤️

kamleshpaul
Автор

For me a interest scenario is when there are so many conditional queries. I don't like many "when" for each sentence, it is not scalable for medium or big applications.
Do you know a sentence that makes easy like validate the data and pass it to a simple method? I head about specification pattern but I don't know how to implement it.
Regards.

maximilianominetto
Автор

if in a form nothing is required but at least one have to select or user can select all then how should I manage the query ? Thanks in advance sir.

santanudas
Автор

You should probably make a video about getting coronavirus data via API. Since data is updated only 2 or 3 times a day, this will be a good use case for cache.

alexrusin
Автор

Thanks so much, it's beautiful tricky

ahmedhdeawy
Автор

You are targeting the real mistakes, everyone did unintentionally and then searching wheres the mistake. 👍

nabeelyousafpasha
Автор

Where can I find you code? Looks like a sortable table in Frontend. I am interested in this frontend table 👍

Cris-prwl
Автор

that's really nice video
but I mostly preferred this in this type of situation
and can we use CASE statements in Eloquent way if yes so Please make one video on it
thanks :)

devappsinvo
Автор

Can u p please give some example regarding laravel passport for api that would be really helpful

vasudevane.p
Автор

funny how query is searching date > 9 and date <= 65 and returns the opposite :)

raimonds.L