让分类、会员和示例工具共用同一账号,本地即可跑通登录与授权。 Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
847 B
PHP
37 lines
847 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class OauthRefreshToken extends Model
|
|
{
|
|
protected $fillable = [
|
|
'token_hash', 'oauth_access_token_id', 'oauth_client_id', 'user_id', 'expires_at', 'revoked_at', 'replaced_by_id',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'expires_at' => 'datetime',
|
|
'revoked_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function accessToken(): BelongsTo
|
|
{
|
|
return $this->belongsTo(OauthAccessToken::class, 'oauth_access_token_id');
|
|
}
|
|
|
|
public function client(): BelongsTo
|
|
{
|
|
return $this->belongsTo(OauthClient::class, 'oauth_client_id');
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|