44 lines
814 B
PHP
44 lines
814 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Laravel\Passport\Token;
|
|
|
|
class AccessToken extends Token
|
|
{
|
|
/**
|
|
* @var list<string>
|
|
*/
|
|
protected $fillable = [
|
|
'id',
|
|
'user_id',
|
|
'client_id',
|
|
'workspace_id',
|
|
'name',
|
|
'scopes',
|
|
'revoked',
|
|
'expires_at',
|
|
'last_used_at',
|
|
];
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'scopes' => 'json',
|
|
'revoked' => 'bool',
|
|
'expires_at' => 'datetime',
|
|
'last_used_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function workspace(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Workspace::class);
|
|
}
|
|
}
|