Now, you can register global scopes on your Eloquent models using PHP Attributes. In this video, let's look at the new and old booted style of implementing addGlobalScope.
Read More:
→ laravel-news.com/laravel-10-44-0
⏰ Timestamps: Laravel Global Model Scopes
0:00 - Laravel Global Model Scopes introduction
0:21 - Creating a new Laravel model scope
1:32 - Apply the model scope as an attribute
1:57 - Using the booted style to addGlobalScope
2:25 - Conclusion
----------------------------------------------------------------------
JOIN OUR WEEKLY LARAVEL NEWSLETTER
👉 laravel-news.com/newsletter
----------------------------------------------------------------------
➫ Business Inquires: hello@laravel-news.com
#laravel #laravelphp #laraveltutorial
13 авг 2024