feat: Implement refresh token system for client authentication, including token creation, rotation, and revocation.

This commit is contained in:
pbao9
2026-03-16 10:23:11 +07:00
parent 44f4f64b37
commit c2e90696b6
4 changed files with 232 additions and 41 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class RefreshToken extends Model
{
protected $fillable = [
'customer_id',
'token',
'expires_at',
];
protected $casts = [
'expires_at' => 'datetime',
];
public function customer()
{
return $this->belongsTo(Customer::class);
}
public function isExpired(): bool
{
return $this->expires_at->isPast();
}
}