How to use Sentry with Greedy in Laravel?

In my models, I use Ardent for self-checking, but I have a model where I also need to use Sentry for authentication. Therefore, I also need to extend Ardent and Sentry, but I can not, because in PHP there is no multiple inheritance. I tried to do this with traits, but traits cannot propagate. I hardly need both classes, is there a way I can use both of them?

+6
source share
1 answer

I think the best way to do this is to copy the entire user model directly from the Sentry folder: e.g. SRC / Cartalyst / Sentry / Users / Eloquent / User.php

Copy this file to the model directory, then add it instead of Ardent instead of Model, since Ardent already extends the model.

This should work - although there may be some complications or corrections necessary for it to work, I am doing something similar using Toddish / Verify instead of Sentry.

+1
source

Source: https://habr.com/ru/post/950886/


All Articles