Open rustwayne opened 5 years ago
how to assign role to user base on file role_permission.txt where i must put it?
Did you figure out where to put it?
What I try to do :
use App\User use Spatie\Permission\Models\Role $u1 = User::find(1) $u2 = User::find(2) $u3 = User::find(3) $r1 = Role::where('name','Root')->first() $r2 = Role::where('name','Admin')->first() $r3 = Role::where('name','User')->first() $u1->assignRole($r1) $u2->assignRole($r2) $u3->assignRole($r3)
The Error I get :
TypeError: Return value of App\User::getStoredRole() must implement interface Spatie\Permission\Contracts\Role
same, how to configure root user?
What I try to do :
The Error I get :
TypeError: Return value of App\User::getStoredRole() must implement interface Spatie\Permission\Contracts\Role