36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Database\Factories;
|
||
|
|
|
||
|
|
use App\Modules\Movies\Models\Movie;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @extends Factory<Movie>
|
||
|
|
*/
|
||
|
|
class MovieFactory extends Factory
|
||
|
|
{
|
||
|
|
protected $model = Movie::class;
|
||
|
|
|
||
|
|
public function definition(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'provider' => 'omdb',
|
||
|
|
'provider_id' => $this->faker->unique()->bothify('tt########'),
|
||
|
|
'external_ids' => [
|
||
|
|
'imdb' => $this->faker->bothify('tt########'),
|
||
|
|
'omdb' => $this->faker->bothify('tt########'),
|
||
|
|
],
|
||
|
|
'title' => $this->faker->sentence(3),
|
||
|
|
'original_title' => $this->faker->sentence(3),
|
||
|
|
'description' => $this->faker->paragraph(),
|
||
|
|
'poster_url' => $this->faker->imageUrl(300, 450, 'movie', true),
|
||
|
|
'backdrop_url' => $this->faker->imageUrl(1280, 720, 'movie', true),
|
||
|
|
'rating' => $this->faker->randomElement(['G','PG','PG-13','R','NC-17']),
|
||
|
|
'release_date' => $this->faker->date(),
|
||
|
|
'year' => (int) $this->faker->year(),
|
||
|
|
'runtime' => $this->faker->numberBetween(60, 180),
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|