Files
lotteryLaravel/app/Models/Player.php

35 lines
696 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* 主站玩家在本地映射账号(表 players与 SSO JWT 中 site_code + site_player_id 对应。
*/
final class Player extends Model
{
protected $fillable = [
'site_code',
'site_player_id',
'username',
'nickname',
'default_currency',
'status',
'last_login_at',
];
protected function casts(): array
{
return [
'last_login_at' => 'datetime',
];
}
public function wallets(): HasMany
{
return $this->hasMany(PlayerWallet::class);
}
}