Is it possible to combine the Sentry package and the Ardent package for Laravel? I want to use Ardent for validations while registering users, while Sentry is for authentication.
Asked
Active
Viewed 208 times
1
-
2They do different things. One is built for authentication & authorization, and the other is to validate input. So yes, it's possible. Just use them as instructed in their manual. You shouldn't need to do anything fancy to get them both to work together. – Kemal Fadillah Jun 09 '14 at 09:42
-
then how can I extend both of then in my model? In order for the ardent to be used you need to extend your model class (class user extends ardent) and it's the same for the sentry (class User extends SentryUserModel) – user2734966 Jun 09 '14 at 15:57
-
1@KemalFadillah You can't extend more than one base class. – Aken Roberts Jun 10 '14 at 01:42
-
@Cryode Whoops! I was stupid enough into thinking that he'd happily have either his Ardent or Sentry class extends the other. Anyway, I think it might be possible to solve this using object composition. – Kemal Fadillah Jun 10 '14 at 02:43
-
You need to extend both in order to utilize their features. None of them provides a trait version. – Halil Özgür Jul 11 '14 at 13:02