2020-10-21 15:26:21 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
2023-08-24 13:00:43 +02:00
|
|
|
/**
|
|
|
|
|
* GainView.
|
|
|
|
|
*
|
|
|
|
|
* @property string $name Name
|
|
|
|
|
* @property string $file_name Name of the view file.
|
|
|
|
|
* @property-read \Illuminate\Support\Carbon $created_at Creation Date.
|
|
|
|
|
* @property-read \Illuminate\Support\Carbon $updated_at Last update Date.
|
|
|
|
|
*
|
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Prizes[] $prizes
|
|
|
|
|
* Associated prizes.
|
|
|
|
|
*/
|
2020-10-21 15:26:21 +02:00
|
|
|
class GainView extends Model
|
|
|
|
|
{
|
2022-01-11 12:39:28 +01:00
|
|
|
/**
|
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
2023-08-24 13:00:43 +02:00
|
|
|
protected $fillable = [
|
|
|
|
|
'name',
|
|
|
|
|
'file_name'
|
|
|
|
|
];
|
2020-10-21 15:26:21 +02:00
|
|
|
|
2022-08-11 10:26:29 +02:00
|
|
|
/**
|
|
|
|
|
* Prize relation
|
2023-08-24 13:00:43 +02:00
|
|
|
*
|
2022-08-11 10:26:29 +02:00
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
|
*/
|
2021-08-18 17:08:02 +02:00
|
|
|
public function prizes()
|
|
|
|
|
{
|
2022-01-11 12:39:28 +01:00
|
|
|
return $this->hasMany(Prize::class, 'gain_view_id');
|
2020-10-21 15:26:21 +02:00
|
|
|
}
|
|
|
|
|
}
|