App\Models\Users can access Filament locally. To allow them to access Filament in production, you must take a few extra steps to ensure that only the correct users have access to the admin panel.
Authorizing access to the admin panel
To set up yourApp\Models\User to access Filament in non-local environments, you must implement the FilamentUser contract:
canAccessFilament() method returns true or false depending on whether the user is allowed to access Filament. In this example, we check if the user’s email ends with @yourdomain.com and if they have verified their email address.
Setting up avatars
Out of the box, Filament uses ui-avatars.com to generate avatars based on a user’s name. To provide your own avatar URLs, you can implement theHasAvatar contract:
getFilamentAvatarUrl() method is used to retrieve the avatar of the current user. If null is returned from this method, Filament will fall back to ui-avatars.com.
Configuring the name attribute
By default, Filament will use thename attribute of the user to display their name in the admin panel. To change this, you can implement the HasName contract:
getFilamentName() method is used to retrieve the name of the current user.