31 lines
521 B
PHP
31 lines
521 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class RefreshToken extends Model
|
|
{
|
|
protected $fillable = [
|
|
'customer_id',
|
|
'token',
|
|
'expires_at',
|
|
'revoked_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'expires_at' => 'datetime',
|
|
'revoked_at' => 'datetime',
|
|
];
|
|
|
|
public function customer()
|
|
{
|
|
return $this->belongsTo(Customer::class);
|
|
}
|
|
|
|
public function isExpired(): bool
|
|
{
|
|
return $this->expires_at->isPast();
|
|
}
|
|
}
|