Laravel Pro Tips
#models #traits
On your #laravel models, keep them clean, with only the native public methods, like relationships, Mutators, ... And if you need to extend your Model logic with business methods, then you can create a "Services" Trait for that π
Bruno FalcΓ£o π
πΆοΈ #Laravel Tip: ππ§πππ©π¨ allows us to share code among Classes & specifically ππ€πππ‘π¨. You can seamlessly integrate with the Model booting & initialization process using traits. β Statically via boot{Trait} β Dynamically via initialize{Trait}
Bilal Haidar - Available 4 Laravel gigs
#enums #traits
A few days ago, I learned that PHP enums can use traits It may seem like a massive anti-pattern, but it allows making enums actually awesome with this one trick π₯
ARCHTECH
No articles were found.