43 lines
898 B
PHP
43 lines
898 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class UserBonus extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'promo_id',
|
|
'amount',
|
|
'wager_required',
|
|
'wager_progress',
|
|
'expires_at',
|
|
'is_active',
|
|
'completed_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'amount' => 'decimal:4',
|
|
'wager_required' => 'decimal:4',
|
|
'wager_progress' => 'decimal:4',
|
|
'expires_at' => 'datetime',
|
|
'is_active' => 'boolean',
|
|
'completed_at' => 'datetime',
|
|
];
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function promo(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Promo::class);
|
|
}
|
|
}
|