Files
SkinbaseNova/database/seeders/HomepageAnnouncementLaunchSeeder.php

59 lines
2.7 KiB
PHP

<?php
declare(strict_types=1);
namespace Database\Seeders;
use App\Models\HomepageAnnouncement;
use Illuminate\Database\Seeder;
use Illuminate\Support\Carbon;
use cPad\Plugins\News\Models\NewsArticle;
final class HomepageAnnouncementLaunchSeeder extends Seeder
{
public function run(): void
{
$launchStory = NewsArticle::query()->firstWhere('slug', 'skinbase-nova-is-live');
HomepageAnnouncement::query()->updateOrCreate(
[
'placement' => HomepageAnnouncement::PLACEMENT_HOMEPAGE_AFTER_FEATURED,
'type' => HomepageAnnouncement::TYPE_LAUNCH,
'title' => 'Skinbase is live.',
],
[
'subtitle' => 'A new chapter for the Skinbase creative community.',
'badge_text' => 'Launch Day · 1 May 2026',
'content_html' => implode("\n", [
'<p><strong>Today, 1 May 2026, Skinbase begins a new chapter.</strong></p>',
'<p>Skinbase is a modern reboot of our creative community for digital art, wallpapers, skins, photography, customization, and discovery.</p>',
'<p>We are bringing the spirit of classic Skinbase into a faster, cleaner, and more modern experience — built for creators, fans, and the future.</p>',
'<p>Welcome to <strong>Skinbase</strong>.</p>',
]),
'status' => HomepageAnnouncement::STATUS_PUBLISHED,
'is_active' => true,
'starts_at' => Carbon::create(2026, 5, 1, 0, 0, 0),
'ends_at' => null,
'primary_link_label' => 'Explore Nova',
'primary_link_type' => HomepageAnnouncement::LINK_TYPE_EXPLORE,
'primary_link_url' => '/explore',
'primary_link_target_type' => null,
'primary_link_target_id' => null,
'secondary_link_label' => $launchStory ? 'Read the launch story' : null,
'secondary_link_type' => $launchStory ? HomepageAnnouncement::LINK_TYPE_NEWS : HomepageAnnouncement::LINK_TYPE_NONE,
'secondary_link_url' => $launchStory ? null : null,
'secondary_link_target_type' => $launchStory ? HomepageAnnouncement::LINK_TYPE_NEWS : null,
'secondary_link_target_id' => $launchStory?->id,
'background_type' => null,
'background_image' => null,
'gradient_preset' => HomepageAnnouncement::GRADIENT_NOVA_AURORA,
'theme_preset' => 'launch',
'text_color' => null,
'overlay_opacity' => 55,
'priority' => 100,
'is_dismissible' => true,
'dismiss_version' => 1,
]
);
}
}