mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
no message
This commit is contained in:
1 parent
214b4d4606
commit
54c850f1ae
3 files changed
+16
-9
No files matched your search
@@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Laravel\Sanctum\PersonalAccessToken;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
@@ -49,4 +50,11 @@ class User extends Authenticatable
|
||||
return $this->hasMany(SubTask::class);
|
||||
}
|
||||
|
||||
public static function getUserIdFromBearerToken($token)
|
||||
{
|
||||
$token = PersonalAccessToken::findToken($token);
|
||||
|
||||
return $token->tokenable_id;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user