build: initialize RetroHub with Laravel, Inertia, Vue, and Horizon
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Features\Consoles\Models\Console;
|
||||
use App\Features\Games\Models\Game;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class GameFactory extends Factory
|
||||
{
|
||||
protected $model = Game::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
$title = fake()->unique()->words(3, true);
|
||||
|
||||
return [
|
||||
'console_id' => Console::factory(),
|
||||
'title' => $title,
|
||||
'slug' => Str::slug($title),
|
||||
'description' => fake()->optional()->paragraph(),
|
||||
'release_year' => fake()->optional()->year(),
|
||||
'developer' => fake()->optional()->company(),
|
||||
'publisher' => fake()->optional()->company(),
|
||||
'genre' => fake()->optional()->randomElement(['Action', 'RPG', 'Platformer', 'Puzzle', 'Sports']),
|
||||
'rating' => fake()->optional(0.7)->randomFloat(1, 0, 10),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user