26 lines
608 B
PHP
26 lines
608 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Foundation;
|
||
|
|
||
|
use Laravel\Sanctum\PersonalAccessToken as SanctumPersonalAccessToken;
|
||
|
|
||
|
class PersonalAccessToken extends SanctumPersonalAccessToken
|
||
|
{
|
||
|
protected $table = 'app_personal_access_tokens';
|
||
|
|
||
|
protected $fillable = ['name', 'token', 'abilities', 'expires_at', 'meta'];
|
||
|
|
||
|
protected $casts = [
|
||
|
'abilities' => 'json',
|
||
|
'meta' => 'json',
|
||
|
'last_used_at' => 'datetime',
|
||
|
'expires_at' => 'datetime',
|
||
|
];
|
||
|
|
||
|
public function addMeta($data)
|
||
|
{
|
||
|
$data = array_merge($this->meta, $data);
|
||
|
$this->update(['meta' => $data]);
|
||
|
}
|
||
|
}
|