Source: stefrouschop.nl

When to use Laravel global scopes
Laravel global scopes are great, but I don't see them used a lot. Instead, I see a lot of local scopes being used to achieve the same thing.

But I learned to ask myself this question when I create a local scope: “Will the majority of the queries for this model use this local scope”.

After that, you should let your model be aware of the global scope: get(); Anonymous Global Scopes

Personally, I don't like anonymous global scopes since it can bloat your model if the query is a bit complex.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners