Replies: 3 comments 4 replies
-
Unfortunately there's no solution to extend two classes. I suggest reimplementing Laravel's |
Beta Was this translation helpful? Give feedback.
-
Do you think something like this might fit in this package? This is more-or-less what you suggested right? <?php
namespace App\Support;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\MustVerifyEmail;
use Illuminate\Auth\Passwords\CanResetPassword;
use Spatie\EventSourcing\Projections\Projection;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Foundation\Auth\Access\Authorizable;
class AuthenticatableProjection extends Projection implements
AuthenticatableContract,
AuthorizableContract,
CanResetPasswordContract
{
use Authorizable;
use Authenticatable;
use MustVerifyEmail;
use CanResetPassword;
} |
Beta Was this translation helpful? Give feedback.
-
Thank you for tips,
but unfortunately in next step I'm getting project specific exception and the only way to fix it is to rewrite authentication logic. I won't do that, instead of it I will create another model and make relationship between them
|
Beta Was this translation helpful? Give feedback.
-
How I can achieve authenticable projection?
I made guard for projection model
Consultant
and to laravel auth works it needs to extendBut projection also is abstract class.
https://laracasts.com/discuss/channels/laravel/make-model-authenticable-when-it-is-extending-another-class
Beta Was this translation helpful? Give feedback.
All reactions