41 lines
899 B
PHP
41 lines
899 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class UserStats extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'total_logins',
|
|
'total_wagered',
|
|
'total_won',
|
|
'total_lost',
|
|
'biggest_win',
|
|
'biggest_win_game',
|
|
'total_wins',
|
|
'vip_level',
|
|
'vip_points',
|
|
'last_activity',
|
|
];
|
|
|
|
protected $casts = [
|
|
'total_wagered' => 'encrypted',
|
|
'total_won' => 'encrypted',
|
|
'total_lost' => 'encrypted',
|
|
'biggest_win' => 'encrypted',
|
|
'total_wins' => 'integer',
|
|
'vip_points' => 'integer', // not encrypted in migration
|
|
'last_activity' => 'datetime',
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
}
|