Currently I have a global scope that filters models by the logged in user’s account_id. I have used an interface to make sure I implement the boot method on the models I need it on. This works perfectly fine, but is quite repetitive.
So I’d like to know how to implement this global scope through a trait, just like laravel’s own soft deletes trait.
Any tips or helpers in the right direction would be much appreciated?
Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.