Answers for "create role spatie"

PHP
1

laravel spatie asigne role

$role->givePermissionTo($permission);
$permission->assignRole($role);
Posted by: Guest on August-12-2021
0

create role spatie

// Create a role or permission if necessary
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;

$role = Role::create(['name' => 'writer']);
$permission = Permission::create(['name' => 'edit articles']);
Posted by: Guest on April-13-2021

Browse Popular Code Answers by Language