init
This commit is contained in:
25
app/Foundation/PersonalAccessToken.php
Normal file
25
app/Foundation/PersonalAccessToken.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user