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