Articles

Which is faster: whereHas vs join

1 day ago

I have heard multiple times that whereHas queries are slower than join queries, so I decided to test it to figure out if I should stop writing whereHa...

Read more

Query a nested relationship with "where" clause using Eloquent

1 week ago

If you've ever run into a problem where you need to filter an Eloquent model by a relationship of a relationship and also eager load both of those rel...

Read more

Eloquent under the hood: where is the where method?

3 weeks ago

When you look through the source code for the Model class, you might be surprised to find that the where method (along with other methods used to crea...

Read more

What's the N+1 problem and how do you avoid it?

3 weeks ago

Picture this, your page is taking too long to load, you use Laravel debugbar, Telescope, or another debugging tool to figure out what's happening. The...

Read more

5 Eloquent features you might have missed

1 month ago

Eloquent is one of the most powerful features of the Laravel framework. You can use Eloquent daily for years without knowing all the features it has t...

Read more