ldc-gen-game-web/app/Models/InstantWin.php

52 lines
1,004 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class InstantWin extends Model
{
/**
* Indicates if the model should be timestamped.
*
* @var boolean
*/
public $timestamps = false;
/**
* The relations to eager load on every query.
*
* @var array
*/
protected $with = ['prize'];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'won' => 'bool',
'appear_date' => 'datetime'
];
/**
* BelongsTo Prize relation
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function prize()
{
return $this->belongsTo(Prize::class, 'prize_id');
}
/**
* One to one relation participation
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function participation()
{
return $this->belongsTo(Participation::class);
}
}