Filament Access

What I am trying to do: I want give filament access to the particular user role.
What I did: I used public function canAccessFilament(): bool inside the user model.
My issue/the error:
Cannot redeclare App\Models\User::canAccessFilament()
Code:
public function canAccessFilament(): bool
{
return $this->role != 'member';
}
Was this page helpful?