Hi all,
I'm using Cartalyst's Sentry 2 (works great) with L4 but I need to add a relationship so that a Sentry user hasMany of something.
I can make it work easily enough by modifying the Sentry package's User class but if I run composer update and get a new version of Sentry, my change will be lost. That's cool - I understand that.
I thought maybe creating a new User class that extends the Sentry User class but I'm not sure if that's the best way (or even if it would work). I'm not using Laravel's authentication class at all so having my own class called User wouldn't be an issue.
So I'm wondering - how should I handle this? Architecturally speaking I'm not what the best approach would be.
Suggestions?
Thanks
Writing a class that extends the default Sentry model is most definitely the way to go.
Adding functionality to an existing class without modifying existing code is basically the entire point of inheritance.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community