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

52 lines
967 B
PHP
Raw Permalink Normal View History

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