Single-auth Mutltitrust (Model)


Model setup

It’s single-auth so one model setup …….. It’s laravel default auth system roles and permissions.

User Model

<?php
use Code4mk\Multitrust\Traits\HasRoleAndPermission;
use Code4mk\Multitrust\Contracts\HasRoleAndPermission as HasRoleAndPermissionContract;
class User extends Authenticatable implements HasRoleAndPermissionContract
{
use HasRoleAndPermission;
}
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Code4mk\Multitrust\Traits\HasRoleAndPermission;
use Code4mk\Multitrust\Contracts\HasRoleAndPermission as HasRoleAndPermissionContract;
class User extends Authenticatable implements HasRoleAndPermissionContract
{
use Notifiable;
use HasRoleAndPermission;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
}