Let's Make a Scope in Laravel

Опубликовано: 01 Ноябрь 2024
на канале: Josh Cirre
1,434
80

I learned something from a YouTube comment, so I wanted to teach you too. What actually happens when you run php artisan make:scope and when would you want to use them in your application?

Scopes docs:
https://laravel.com/docs/11.x/eloquen...

**me using the boot method on the model is fine but unnecessary. you can either use an attribute or the “booted” method to help achieve the same scope, as outlined in the docs. :)

Keep creating.

---
📹 *Watch My VSCode Setup Video:*    • My Minimal and Beautiful VSCode Setup  

🎓 *Make VSCode Awesome – Caleb Porzio's Course (support me with this link):* https://gumroad.com/a/636621331