50 lines
1.5 KiB
PHP
50 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Artwork;
|
|
use App\Models\WorldWebStory;
|
|
use App\Models\WorldWebStoryPage;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<WorldWebStoryPage>
|
|
*/
|
|
class WorldWebStoryPageFactory extends Factory
|
|
{
|
|
protected $model = WorldWebStoryPage::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'story_id' => WorldWebStory::factory(),
|
|
'artwork_id' => null,
|
|
'position' => 1,
|
|
'layout' => WorldWebStoryPage::LAYOUT_ARTWORK,
|
|
'background_type' => WorldWebStoryPage::BACKGROUND_IMAGE,
|
|
'background_path' => 'web-stories/worlds/example/pages/page-01.webp',
|
|
'background_mobile_path' => 'web-stories/worlds/example/pages/page-01.webp',
|
|
'headline' => 'Story headline',
|
|
'body' => 'Short supporting copy for this world web story page.',
|
|
'cta_label' => null,
|
|
'cta_url' => null,
|
|
'alt_text' => 'World story background',
|
|
'caption' => 'Skinbase World',
|
|
'credit_text' => null,
|
|
'text_position' => 'bottom',
|
|
'overlay_strength' => 35,
|
|
'animation' => 'fade-in',
|
|
'active' => true,
|
|
];
|
|
}
|
|
|
|
public function withArtwork(): self
|
|
{
|
|
return $this->state(fn (): array => [
|
|
'artwork_id' => Artwork::factory(),
|
|
'layout' => WorldWebStoryPage::LAYOUT_ARTWORK,
|
|
]);
|
|
}
|
|
} |