I used php artisan make:auth
command in my Laravel project and this is how my unchanged App\Models\User.php
looks like:
<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];}
Now, according to Entrusts documentation I should change the User.php
file to the following:
<?php
use Zizaco\Entrust\Traits\EntrustUserTrait;
class User extends Eloquent
{
use EntrustUserTrait; // add this trait to your user model
...
}
I want to use Laravel built-in Auth system with Entrust user roles. How can I mix these two to work together? As I have read, it is not possible to use multiple extends. Any simple solutions?