Search code examples
phplaravelauthenticationardent

Laravel 5.5. using authentication and Ardent


I'm having trouble using Ardent package with Laravel authentication.

The problem is that in order to use Laravel authentication I have to extend my User model with Authenticatable (use Illuminate\Foundation\Auth\User as Authenticatable;)

But in order to use Ardent, I need to extend my User model with Ardent.

PHP doesn't support multiple inheritance (thank god), so now I am out of ideas on how to solve this?


Solution

  • Authenticatable is an interface. So, you can create User extending Arden and implementing Authenticatable.

    You can only extend one class but implement multiple interfaces:

    class User extends Arden implements Authenticatable { ... }