26 lines
629 B
PHP
26 lines
629 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Features\Games\Models\Game;
|
|
use App\Features\Games\Models\RomFile;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class RomFileFactory extends Factory
|
|
{
|
|
protected $model = RomFile::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
$filename = fake()->word().'.nes';
|
|
|
|
return [
|
|
'game_id' => Game::factory(),
|
|
'file_path' => "roms/nes/{$filename}",
|
|
'file_name' => $filename,
|
|
'file_size' => fake()->numberBetween(100000, 10000000),
|
|
'file_hash' => hash('sha256', fake()->uuid()),
|
|
];
|
|
}
|
|
}
|