2026-05-20 18:25:15 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
|
|
|
|
|
class Game extends Model
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var string[]
|
|
|
|
|
*/
|
|
|
|
|
protected $fillable = ['name', 'slug', 'platform_id', 'genre_id' ];
|
|
|
|
|
|
|
|
|
|
public function platform(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Platform::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function genre(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Genre::class);
|
|
|
|
|
}
|
2026-06-08 16:25:52 +02:00
|
|
|
|
|
|
|
|
public function entries(): Game|\Illuminate\Database\Eloquent\Relations\HasMany
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(Entry::class);
|
|
|
|
|
}
|
2026-05-20 18:25:15 +02:00
|
|
|
}
|