ldc-gen-game-web/app/Models/InstantWin.php
Jérémy Munsch 1af96897f3
- Squash migration
- Normalize Model names and sql tables
- PHPCS clean up
- Change analytics form + field
2022-01-11 12:46:10 +01:00

51 lines
967 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'
];
/**
* 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);
}
}