'boolean', 'backdrop' => 'boolean', 'genres_id' => 'integer', 'releasedate' => 'date', ]; /** * Get the genre for this game. */ public function genre(): BelongsTo { return $this->belongsTo(Genre::class, 'genres_id'); } /** * Get the releases for this game. */ public function releases(): HasMany { return $this->hasMany(Release::class, 'gamesinfo_id'); } public function searchableAs(): string { return 'ix_title_ft'; } public function toSearchableArray(): array { return [ 'title' => $this->title, ]; } /** * Get the cover image path. */ public function getCoverPath(): ?string { if (!$this->cover) { return null; } $path = config('nntmux_settings.covers_path') . '/games/' . $this->id . '.jpg'; return file_exists($path) ? $path : null; } /** * Get the backdrop image path. */ public function getBackdropPath(): ?string { if (!$this->backdrop) { return null; } $path = config('nntmux_settings.covers_path') . '/games/' . $this->id . '-backdrop.jpg'; return file_exists($path) ? $path : null; } }