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