Add filament
This commit is contained in:
12
app/User.php
12
app/User.php
@ -4,8 +4,10 @@ namespace App;
|
||||
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Models\Contracts\HasName;
|
||||
|
||||
class User extends Authenticatable
|
||||
class User extends Authenticatable implements FilamentUser,HasName
|
||||
{
|
||||
use Notifiable;
|
||||
|
||||
@ -26,4 +28,12 @@ class User extends Authenticatable
|
||||
protected $hidden = [
|
||||
'password', 'remember_token',
|
||||
];
|
||||
public function canAccessFilament(): bool
|
||||
{
|
||||
return str_ends_with($this->email, '@tfmm.co');
|
||||
}
|
||||
public function getFilamentName(): string
|
||||
{
|
||||
return "{$this->name}";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user