i dont know why this error in another browser work ok and not show this error and say problem is
User Model
public function role()
{
return $this->belongsTo(Role::class);
}
public function hasPermission($name)
{
return $this->role->permissions()->where('name',$name)->exists();
}
Role Model
public function permissions()
{
return $this->belongsToMany(Permission::class);
}
i make roles and permission and pivot table an use Policy
and this my policy
public function viewAll(User $user)
{
return $user->hasPermission('view_category');
}
and this controller
public function AllCat()
{
$this->authorize("viewAll",Category::class);
return $this->categoryInterface->AllCat();
}
in google chrome work ok and brave but edge show this error .