Querying Eloquent Relationships in Effective Way

Querying Eloquent Relationships in Effective Way

Laravel Daily

5 лет назад

14,906 Просмотров

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


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

@joshuaheathcote2116
@joshuaheathcote2116 - 02.02.2022 01:09

Eloquent makes working with the DB a joy.

Ответить
@tothebone4613
@tothebone4613 - 30.11.2021 05:08

i have "seaman and status model, has many relation" i want to see list of seaman that have spesific status on each status view like Ready to go, unscheduled, onboard etc. any suggest ?

Ответить
@anilchudasama462
@anilchudasama462 - 19.05.2021 17:17

super as always

Ответить
@bl1ngy628
@bl1ngy628 - 29.04.2021 03:55

Best video to understand Eloquent Relationships, thank you !

Ответить
@spraydeveloper5452
@spraydeveloper5452 - 19.01.2021 08:33

Hello, can you please explain the difference betwen Users::groups() and Users::with('groups'), I read that is Eager Loads, but i dont inderstand it fully, thank you :)

Ответить
@dmdk8301
@dmdk8301 - 12.12.2020 07:45

Is it normal to query Author within Bookcontroller?
I am a bit confused again.

What should be next?
I mean attach books to author in order to display? Or i blade?

Its common for me and trying to avoid this sometimes i stuck and loose time.

Ответить
@rhnnf3502
@rhnnf3502 - 08.11.2020 17:42

Thanks! Really helpful videos :)

Ответить
@kampus93
@kampus93 - 10.09.2020 11:53

sir please make video for 3 table query or more in eloquent...

Ответить
@nareshvadhavana9273
@nareshvadhavana9273 - 15.10.2019 17:48

High rate of full course

Ответить
@rfpdl
@rfpdl - 09.09.2019 17:13

Did not know you can chain dd() to the query itself. Thank you

Ответить
@janussQv
@janussQv - 22.11.2018 20:12

Be careful using whereHas with deep nesting, it can be really demanding, if you're not careful, or the database design sucks. Use DB query logging while developing, e.g. tools like barryvdh/laravel-debugbar or a simple

DB::listen(
function ($event) {
if ($event->time > 2500 || env('LOG_ALL_QUERIES')) {
Log::info('LONG QUERY: ' . $event->time . ' -> ' . $event->sql);
}});

somewhere in the code you are interested in.

Ответить
@developmentteam6205
@developmentteam6205 - 19.11.2018 22:53

Marvelous! I haven't used "has' and 'whereHas' clauses so far, but now I'll give it a try with precaution! :D

Ответить