Тёмный

Eloquent where(): 6 "Tricks" You May Not Know 

Laravel Daily
Подписаться 140 тыс.
Просмотров 9 тыс.
50% 1

Over the years, I've seen a lot of less-known usages of where() in Eloquent and Query Builder, let me show you a few of them.
Links mentioned in the video:
- Docs: Basic Where Clauses: laravel.com/docs/11.x/queries...
- Docs: Additional Where Clauses: laravel.com/docs/11.x/queries...
- Docs: Advanced Where Clauses: laravel.com/docs/11.x/queries...
- My course "Laravel Eloquent: Expert Level" laraveldaily.com/course/larav...
- - - - -
Support the channel by checking out my products:
- My Laravel courses: laraveldaily.com/courses
- Filament examples: filamentexamples.com
- Livewire Kit Components: livewirekit.com
- - - - -
Other places to follow:
- My weekly Laravel newsletter: us11.campaign-archive.com/hom...
- My personal Twitter: / povilaskorop

Хобби

Опубликовано:

 

12 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@fanievdm1
@fanievdm1 Месяц назад
Thanks for the tips. One tends to do the 'old stuff' instead of enhancing your code. The tips are very helpful.
@chlouis-girardot
@chlouis-girardot Месяц назад
Such valuable information/reminders, thank you (again) Sir! 🙏
@LoganathanNatarajanlogudotcom
@LoganathanNatarajanlogudotcom 25 дней назад
Thanks for the detailed explanation..
@asfiaaiman3699
@asfiaaiman3699 27 дней назад
Thanks for these useful tips
@maxzak5310
@maxzak5310 Месяц назад
i like whereAll , whereAny ... very handy
@muhammadumarsotvoldiev8768
@muhammadumarsotvoldiev8768 29 дней назад
Thank you very much!
@SebastianMares
@SebastianMares 29 дней назад
One thing I cannot stress enough is orWhere with scopes or relations. Always use a callback for your orWhere statements. $author->posts()->where('foo', 'bar') will give you all posts belonging to the author where foo is 'bar', but $author->posts()->where('foo', 'bar')->orWhere('abc', 'xyz') will no longer have abc = 'xyz' scoped to the $author. Same goes with scopes. $builder->where('created_at', '', 500); will probalby also not yield what you were expecting.
@SXsoft99
@SXsoft99 Месяц назад
what i always tell people "read the docs". I get it if you come from other frameworks it's a pain
@NitishKumarPatra
@NitishKumarPatra Месяц назад
I didn't get the info about created_at won't work if there is a index on it, and would work then index is created with date ?? Could you please make a video on it ? Such conditions are commonly used throughout projects, but i guess many are unaware, including me.
@LaravelDaily
@LaravelDaily Месяц назад
I mean you need to create an index on DATE(created_at) and not created_at, not sure it needs a video
@fredchess
@fredchess 28 дней назад
Please what do you use to make quick printing like this?
@LaravelDaily
@LaravelDaily 28 дней назад
Tinkerwell
@BBB888BBB
@BBB888BBB Месяц назад
would you please explain why the word(data) is put in page.jsx when using inertia ? example : to loop : projects.data.map(project).... i saw this and i don't know why . ( in working laravel with react inertia) i saw that .
@LaravelDaily
@LaravelDaily Месяц назад
From what I remember, it's how Laravel API resources return the data by default. Read the docs of Eloquent API resources.
Далее
Top 5 Laravel "Bad Practices" (My Opinion)
10:32
Просмотров 17 тыс.
Типичный продавец на пляже 😂
01:00
QVZ
00:31
Просмотров 511 тыс.
ONE Word to Become a (More) Senior Developer
3:00
Просмотров 4,2 тыс.
React Compiler: In-Depth Beyond React Conf 2024
15:16
I've been using Redis wrong this whole time...
20:53
Просмотров 329 тыс.
Wanna Start with Filament? Quick 5-Minute Demo.
7:50
Avoid these 5 beginner CSS mistakes
21:38
Просмотров 64 тыс.
How was this not in the browser before???
16:30
Просмотров 98 тыс.
14 Quick Laravel Tips in 9 Minutes
9:09
Просмотров 8 тыс.
Туристы и шведский стол
0:31
Просмотров 4,8 млн
Копченая рыба
0:41
Просмотров 1,1 млн
Пунш Дешевле Доширака
0:34
Просмотров 748 тыс.