In Laravel 8 app using spatie/laravel-permission ^3.18 I defined in bootstrap/app.php
if ( ! defined("PERMISSION_USE_SERVICES")) {
define("PERMISSION_USE_SERVICES", 'Use services');
}
and in init seeder :
$CustomerRole = Role::create(['name' => ROLE_CUSTOMER, 'guard_name' => 'web']);
$customerUseServicesPermission = Permission::create(['name' => PERMISSION_USE_SERVICES, 'guard_name' => 'web']);
$CustomerRole->givePermissionTo($customerUseServicesPermission); // means : customer use services
and when I register new user in app/Actions/Fortify/CreateNewUser.php I want to give new user customerUseServicesPermission.
In vendor/spatie/laravel-permission/src/Contracts/Permission.php I found method :
interface Permission
{
public static function findByName(string $name, $guardName): self;
But using it I got error :
Cannot call abstract method Spatie\Permission\Contracts\Permission::findByName()
have I to make wrapper file for Contracts/Permission.php and in which way ?
Thanks!