mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-20 08:11:10 -05:00
Add testing environment configuration and create model factories for Operator and Park
This commit is contained in:
28
database/factories/OperatorFactory.php
Normal file
28
database/factories/OperatorFactory.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Operator;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class OperatorFactory extends Factory
|
||||
{
|
||||
protected $model = Operator::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->unique()->company(),
|
||||
'slug' => fake()->unique()->slug(2),
|
||||
'description' => fake()->paragraph(),
|
||||
'website' => fake()->url(),
|
||||
'headquarters' => fake()->city() . ', ' . fake()->country(),
|
||||
'founded_year' => fake()->year(),
|
||||
'total_parks' => fake()->numberBetween(1, 10),
|
||||
'total_rides' => fake()->numberBetween(20, 200),
|
||||
'annual_visitors' => fake()->numberBetween(1000000, 50000000),
|
||||
'employee_count' => fake()->numberBetween(1000, 50000),
|
||||
'revenue' => fake()->numberBetween(100000000, 5000000000),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user