build: initialize RetroHub with Laravel, Inertia, Vue, and Horizon

This commit is contained in:
2026-08-10 13:45:18 +02:00
commit 717db65139
218 changed files with 28356 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
<?php
namespace App\Features\Games\Models;
use App\Features\Consoles\Models\Console;
use App\Features\Settings\Models\SaveFile;
use Database\Factories\GameFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Str;
class Game extends Model
{
/** @use HasFactory<GameFactory> */
use HasFactory;
protected static ?string $factory = GameFactory::class;
protected $fillable = [
'console_id',
'title',
'slug',
'igdb_id',
'tgdb_id',
'description',
'release_year',
'developer',
'publisher',
'genre',
'rating',
'cover_path',
'thumbnail_path',
];
protected $casts = [
'rating' => 'decimal:1',
];
protected static function booted(): void
{
static::creating(function (Game $game) {
if (empty($game->slug)) {
$game->slug = Str::slug($game->title);
}
});
}
public function console(): BelongsTo
{
return $this->belongsTo(Console::class);
}
public function romFiles(): HasMany
{
return $this->hasMany(RomFile::class);
}
public function saveFiles(): HasMany
{
return $this->hasMany(SaveFile::class);
}
public function getRouteKeyName(): string
{
return 'slug';
}
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\Features\Games\Models;
use Database\Factories\RomFileFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class RomFile extends Model
{
/** @use HasFactory<RomFileFactory> */
use HasFactory;
protected static ?string $factory = RomFileFactory::class;
protected $fillable = [
'game_id',
'file_path',
'file_name',
'file_size',
'file_hash',
'region',
'language',
];
public function game(): BelongsTo
{
return $this->belongsTo(Game::class);
}
}