Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nicwek's avatar

Extending a class several times

I am trying to implement extends to a user class two times, how can i do that correctly in laravel?

class User extends \TCG\Voyager\Models\User extends Authenticatable implements MustVerifyEmail
0 likes
4 replies
manelgavalda's avatar

What you can do is to make one User extend the User (parent) class and then make your User (parent) class extend Authenticable. Something like:

User:

use \TCG\Voyager\Models\User as BaseUser;

class User extends BaseUser

User (parent):

class User extends Authenticatable implements MustVerifyEmail
1 like
nicwek's avatar

Thanks alot, guys for the helpful responses. My problem is resolved.

Please or to participate in this conversation.