build: initialize RetroHub with Laravel, Inertia, Vue, and Horizon
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Features\Games\Repositories;
|
||||
|
||||
use App\Features\Games\Models\RomFile;
|
||||
|
||||
class RomFileRepository
|
||||
{
|
||||
public function __construct(
|
||||
private RomFile $model
|
||||
) {}
|
||||
|
||||
public function count(): int
|
||||
{
|
||||
return $this->model->count();
|
||||
}
|
||||
|
||||
public function findByHash(string $hash): ?RomFile
|
||||
{
|
||||
return $this->model->where('file_hash', $hash)->first();
|
||||
}
|
||||
|
||||
public function create(array $data): RomFile
|
||||
{
|
||||
return $this->model->create($data);
|
||||
}
|
||||
|
||||
public function getByGame(int $gameId)
|
||||
{
|
||||
return $this->model->where('game_id', $gameId)->get();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user