fix(Preprod Admin Panel Access)
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m28s
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m28s
This commit is contained in:
@@ -9,6 +9,8 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Fortify\TwoFactorAuthenticatable;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
use Filament\Models\Contracts\FilamentUser;
|
||||
use Filament\Panel;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
@@ -45,7 +47,7 @@ use Spatie\Permission\Traits\HasRoles;
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User withoutRole($roles, $guard = null)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class User extends Authenticatable
|
||||
class User extends Authenticatable implements FilamentUser
|
||||
{
|
||||
use HasRoles, HasFactory, Notifiable, TwoFactorAuthenticatable;
|
||||
|
||||
@@ -83,6 +85,13 @@ class User extends Authenticatable
|
||||
];
|
||||
}
|
||||
|
||||
public function canAccessPanel(Panel $panel): bool
|
||||
{
|
||||
//return str_ends_with($this->email, '@yourdomain.com') && $this->hasVerifiedEmail();
|
||||
//@todo : restreindre aux adresses retzien.fr pour la prod
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public static function getAttributeLabel(string $attribute): string
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user