Refactor project structure and update dependencies
This commit is contained in:
@@ -59,6 +59,22 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
|
||||
public function mustVerifyEmail(): bool
|
||||
{
|
||||
return $this instanceof MustVerifyEmail && !$this->hasVerifiedEmail();
|
||||
return !$this->hasVerifiedEmail();
|
||||
}
|
||||
|
||||
public function createDeviceToken(string $device, string $ip, bool $remember = false): string
|
||||
{
|
||||
$sanctumToken = $this->createToken(
|
||||
$device,
|
||||
['*'],
|
||||
$remember ?
|
||||
now()->addMonth() :
|
||||
now()->addDay()
|
||||
);
|
||||
|
||||
$sanctumToken->accessToken->ip = $ip;
|
||||
$sanctumToken->accessToken->save();
|
||||
|
||||
return $sanctumToken->plainTextToken;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user