mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-01-23 06:38:34 +01:00
Add user's locale preference
This commit is contained in:
parent
44d7328d6c
commit
086dd241d2
@ -6,6 +6,7 @@
|
||||
use App\Models\Traits\WebAuthnManageCredentials;
|
||||
use Illuminate\Auth\Events\PasswordReset;
|
||||
use Illuminate\Auth\Notifications\ResetPassword;
|
||||
use Illuminate\Contracts\Translation\HasLocalePreference;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
@ -41,7 +42,7 @@
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Laragear\WebAuthn\Models\WebAuthnCredential[] $webAuthnCredentials
|
||||
* @property-read int|null $web_authn_credentials_count
|
||||
*/
|
||||
class User extends Authenticatable implements WebAuthnAuthenticatable
|
||||
class User extends Authenticatable implements HasLocalePreference, WebAuthnAuthenticatable
|
||||
{
|
||||
use AuthenticationLoggable;
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
@ -86,6 +87,14 @@ class User extends Authenticatable implements WebAuthnAuthenticatable
|
||||
'demoting',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the user's preferred locale.
|
||||
*/
|
||||
public function preferredLocale() : string
|
||||
{
|
||||
return strval($this->preferences['lang']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include admin users.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user