2026-05-20 18:25:15 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
|
2026-06-10 11:04:26 +02:00
|
|
|
/**
|
|
|
|
|
* @property int $id
|
|
|
|
|
* @property string $name
|
|
|
|
|
* @property string $slug
|
|
|
|
|
* @property int $platform_id
|
|
|
|
|
* @property int $genre_id
|
|
|
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
|
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Entry> $entries
|
|
|
|
|
* @property-read int|null $entries_count
|
|
|
|
|
* @property-read \App\Models\Genre $genre
|
|
|
|
|
* @property-read \App\Models\Platform $platform
|
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Game newModelQuery()
|
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Game newQuery()
|
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Game query()
|
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Game whereCreatedAt($value)
|
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Game whereGenreId($value)
|
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Game whereId($value)
|
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Game whereName($value)
|
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Game wherePlatformId($value)
|
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Game whereSlug($value)
|
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Game whereUpdatedAt($value)
|
|
|
|
|
* @mixin \Eloquent
|
|
|
|
|
*/
|
2026-05-20 18:25:15 +02:00
|
|
|
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
|
|
|
}
|