5 tips for supercharged Laravel Eloquent queries

5 tips for supercharged Laravel Eloquent queries

Andrew Schmelyun

4 года назад

67,869 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@truongpm2144
@truongpm2144 - 28.02.2023 13:22

amazing !!!!

Ответить
@joepalala4757
@joepalala4757 - 19.01.2023 07:31

Another tip, You can now use ->latest() in your queries which will getlatest by created date (afaik)

Ответить
@gergelygrusz713
@gergelygrusz713 - 09.12.2022 23:25

This is brilliant, thank you!

Ответить
@simbarashemaunga5575
@simbarashemaunga5575 - 24.11.2022 18:17

This was an amazing tutorial!

Ответить
@sretksor8689
@sretksor8689 - 20.09.2022 16:33

what is the name of IDE that you using in video?

Ответить
@robertoflores2078
@robertoflores2078 - 11.09.2022 12:02

I've been using Mehradsadeghi\FilterQueryString for years. Forget about if's and when's. Let the library do all that work for you. I can't find a cleaner way to do it.

Ответить
@nightpegasus26
@nightpegasus26 - 01.07.2022 18:53

Thank you Andrew! Just what I was looking for, but couldn't find anywhere else!

Ответить
@naungyehtet1231
@naungyehtet1231 - 31.05.2022 12:33

Subscribed

Ответить
@lawrencediokno4883
@lawrencediokno4883 - 28.04.2022 11:42

how are you formatting your return data to look like that?

Ответить
@pankajbokdia
@pankajbokdia - 19.04.2022 09:22

Super helpful!

Ответить
@javieru5871
@javieru5871 - 30.03.2022 01:32

I think for tip 4, we can also use withCount from Lavaravel 5.2.32 or higher.

Ответить
@sayedahmadnaweed1
@sayedahmadnaweed1 - 20.03.2022 09:50

You are amazing. Thank you

Ответить
@sudheertripathi3882
@sudheertripathi3882 - 19.01.2022 16:35

tip3 is fire

Ответить
@josegerardosanchezalvarado4703
@josegerardosanchezalvarado4703 - 03.01.2022 07:09

esto me salvo la vida User::whereHas('model', function ($query) {
$query->where('propiedad', '!=', 'value');
})->with(['model', 'model'])->get();

Ответить
@atifbashir3991
@atifbashir3991 - 27.09.2021 19:46

Diamond content

Ответить
@fractalzombie
@fractalzombie - 22.09.2021 01:17

Говнокодик конечно… есть ощущение, что только программисты из СНГ заботятся о качестве кода.

Ответить
@mehdiyaghoubi600
@mehdiyaghoubi600 - 21.08.2021 08:49

Thank you, how queries from relations e.g, products belong to a category and products also belongs to a type, how to get query of categories that their products have a specific type?

Ответить
@jailsoncarneiro4936
@jailsoncarneiro4936 - 01.08.2021 21:58

Great Job! Thanks a lot!

Ответить
@arty4
@arty4 - 29.07.2021 12:52

For tip 1 u can use ->when($expr, $callback) function

Ответить
@filella1
@filella1 - 27.07.2021 07:17

Be careful when using whereHas on large databases as it performs a full table scan. I would use join or whereIn instead.

Ответить
@chetanchitte8835
@chetanchitte8835 - 19.07.2021 21:36

You are awesome man, great respect for you! (y)

Ответить
@sebastianromerolaguna7408
@sebastianromerolaguna7408 - 11.07.2021 07:20

Have you think in do an tutorial explaining queries for statistics. I haven seen videos about!.
Have a good day

Ответить
@sebastianromerolaguna7408
@sebastianromerolaguna7408 - 11.07.2021 07:19

Thanks, it help me.

Ответить
@MohanSingh-pl1mi
@MohanSingh-pl1mi - 11.06.2021 06:42

I really like the way you are using to elaborate

Ответить
@iShah300
@iShah300 - 23.05.2021 14:43

Hi andrew
Great tips however i have a question
Hoe about including join if conditiions is true
Like if a request comes so i want to join a new table into existing eloquent query ...

Ответить
@delita0057
@delita0057 - 05.05.2021 17:14

are you doing nuxt js tutorials?

Ответить
@muhammadfahad3483
@muhammadfahad3483 - 28.04.2021 14:48

In the first tip what is ::query() method?

Ответить
@davidspooner4684
@davidspooner4684 - 26.04.2021 01:28

Way too many commercials interrupting this tutorial. Hard to follow with so many interruptions.

Ответить
@aibarra11
@aibarra11 - 23.04.2021 00:42

for the first optimization, there is also ->when for eloquent queries. No need to write out IF statements

Ответить
@silvesterwali6565
@silvesterwali6565 - 22.04.2021 17:06

i love this

Ответить
@hariharan-wt6qk
@hariharan-wt6qk - 21.03.2021 10:11

Thanks a lot❤️

Ответить
@edwinencomienda
@edwinencomienda - 18.03.2021 00:58

what’s your keyboard 😅?

Ответить
@carlosfranciscobenegasbini78
@carlosfranciscobenegasbini78 - 25.02.2021 17:04

Amazinng!

Ответить
@aydnkucukoglu5719
@aydnkucukoglu5719 - 17.02.2021 07:29

Great and perfect. Thank you

Ответить
@guilhermemoraes4055
@guilhermemoraes4055 - 15.02.2021 20:52

What's ".test" on your URL project? Is this somehow online?

Ответить
@mikevazovsky9211
@mikevazovsky9211 - 11.02.2021 13:08

Good!

Ответить
@DRMOHAMEDKHDR
@DRMOHAMEDKHDR - 10.02.2021 23:27

Thanks alot

Ответить
@loremipsum5642
@loremipsum5642 - 09.02.2021 09:26

Hi, can you provide a github repo for this?

Ответить
@rizkihutama5633
@rizkihutama5633 - 03.02.2021 03:42

do you have a video that store json text to database, i'm still strugling with that?

Ответить
@Akimb321
@Akimb321 - 26.01.2021 21:04

I believe there is no information about ::query method in Laravel docs (your first tip). It's an awesome tip, but I can't believe there's no info about this. Or I missed it?

Ответить
@brokoli5797
@brokoli5797 - 25.01.2021 13:03

Great tips! saved my time so much.

Ответить
@epslks
@epslks - 13.01.2021 11:32

I'd looking for tip-two to make a streamlined code for a long time , thanks a lot.
Extraordinary !

Ответить
@sharlay280
@sharlay280 - 22.11.2020 06:49

Tip number 4 is what I’ve been seeking for a long time. Thanks a lot

Ответить
@youtubelndia2622
@youtubelndia2622 - 09.11.2020 09:55

very helpfull sir

Ответить
@ethanj1533
@ethanj1533 - 30.10.2020 09:47

What ide is that?

Ответить
@jecoy9413
@jecoy9413 - 24.10.2020 07:06

what text editor are you using ?

Ответить