| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <?php
-
- namespace App\StorePlan;
-
- use App\Models\Store;
-
- /**
- * A hand-written plan. Used as the format example in AI prompts, by the fake AI provider, and in tests.
- * It uses every section type once.
- */
- final class SamplePlan
- {
- /**
- * @return array<string, mixed>
- */
- public static function for(Store $store): array
- {
- return self::forName($store->name);
- }
-
- /**
- * @return array<string, mixed>
- */
- public static function forName(string $name): array
- {
-
- return [
- 'version' => PlanSchema::VERSION,
- 'theme' => [
- 'colors' => [
- 'background' => '#FBF7F0',
- 'surface' => '#F3EADB',
- 'foreground' => '#2A1A12',
- 'muted' => '#7A6557',
- 'primary' => '#B4411F',
- 'primaryForeground' => '#FFF8F0',
- 'accent' => '#E2A93B',
- 'border' => '#E3D5C0',
- ],
- 'fonts' => ['heading' => 'fraunces', 'body' => 'dm-sans'],
- 'radius' => 'medium',
- ],
- 'sections' => [
- [
- 'id' => 'header',
- 'type' => 'header',
- 'variant' => 'simple',
- 'content' => [
- 'logoText' => $name,
- 'links' => [
- ['label' => 'Shop', 'href' => '#products'],
- ['label' => 'Our story', 'href' => '#about'],
- ['label' => 'FAQ', 'href' => '#faq'],
- ['label' => 'Contact', 'href' => '#contact'],
- ],
- 'cta' => ['label' => 'Shop now', 'href' => '#products'],
- ],
- ],
- [
- 'id' => 'hero',
- 'type' => 'hero',
- 'variant' => 'split',
- 'content' => [
- 'eyebrow' => 'Small batch · Made in Malaysia',
- 'headline' => 'Sambal the way grandma made it',
- 'subheadline' => 'Slow-cooked for six hours with fresh chillies and no preservatives. One spoon turns plain rice into a meal.',
- 'primaryCta' => ['label' => 'Shop the range', 'href' => '#products'],
- 'secondaryCta' => ['label' => 'Our story', 'href' => '#about'],
- ],
- ],
- [
- 'id' => 'products',
- 'type' => 'product_grid',
- 'variant' => 'grid',
- 'content' => [
- 'heading' => 'Best sellers',
- 'subheading' => 'Cooked fresh every week and delivered across Malaysia.',
- 'items' => [
- ['name' => 'Sambal Ikan Bilis', 'price' => 18.90, 'badge' => 'Best seller'],
- ['name' => 'Sambal Hijau', 'price' => 16.90, 'badge' => null],
- ['name' => 'Sambal Petai', 'price' => 21.90, 'badge' => 'New'],
- ['name' => 'Sambal Belacan', 'price' => 15.90, 'badge' => null],
- ],
- ],
- ],
- [
- 'id' => 'featured',
- 'type' => 'featured_product',
- 'variant' => 'image-right',
- 'content' => [
- 'eyebrow' => 'Gift set',
- 'name' => 'The Family Trio',
- 'description' => 'Three of our most loved sambals in one box. A good first order, and an easy gift for anyone who misses home cooking.',
- 'price' => 49.90,
- 'bullets' => [
- 'Three 180g jars',
- 'Keeps for 3 months unopened',
- 'Free delivery in Peninsular Malaysia',
- ],
- 'cta' => ['label' => 'Add to cart', 'href' => '#products'],
- ],
- ],
- [
- 'id' => 'about',
- 'type' => 'about',
- 'variant' => 'with-stats',
- 'content' => [
- 'heading' => 'A family recipe, three generations old',
- 'body' => "$name began in a home kitchen, with a recipe passed from grandmother to mother to daughter. We still cook in small batches, taste every pot, and use chillies bought from the same farms each week.",
- 'stats' => [
- ['value' => '6 hrs', 'label' => 'Slow-cooked per batch'],
- ['value' => '0', 'label' => 'Preservatives'],
- ['value' => '12k+', 'label' => 'Jars delivered'],
- ],
- ],
- ],
- [
- 'id' => 'testimonials',
- 'type' => 'testimonials',
- 'variant' => 'cards',
- 'content' => [
- 'heading' => 'What customers say',
- 'items' => [
- ['quote' => 'Tastes exactly like my late mother\'s sambal. I order four jars every month.', 'name' => 'Aishah R.', 'role' => 'Shah Alam'],
- ['quote' => 'Spicy, but balanced. My kids now ask for it with every meal.', 'name' => 'Daniel L.', 'role' => 'Penang'],
- ['quote' => 'Arrived well packed and fresh. The petai one is dangerous.', 'name' => 'Farah N.', 'role' => 'Johor Bahru'],
- ],
- ],
- ],
- [
- 'id' => 'faq',
- 'type' => 'faq',
- 'variant' => 'list',
- 'content' => [
- 'heading' => 'Common questions',
- 'items' => [
- ['question' => 'How long does it keep?', 'answer' => 'Three months unopened. After opening, keep it in the fridge and finish within four weeks.'],
- ['question' => 'How spicy is it?', 'answer' => 'Most of our sambals are medium. Sambal Hijau is the mildest and Sambal Belacan is the hottest.'],
- ['question' => 'Do you deliver to East Malaysia?', 'answer' => 'Yes. Delivery to Sabah and Sarawak takes three to five working days.'],
- ],
- ],
- ],
- [
- 'id' => 'newsletter',
- 'type' => 'newsletter',
- 'variant' => 'banner',
- 'content' => [
- 'heading' => 'Get 10% off your first order',
- 'body' => 'Join our list for new flavours and recipes. No spam.',
- 'placeholder' => 'Your email address',
- 'buttonLabel' => 'Sign up',
- ],
- ],
- [
- 'id' => 'contact',
- 'type' => 'contact',
- 'variant' => 'simple',
- 'content' => [
- 'heading' => 'Talk to us',
- 'body' => 'Questions about an order, or want to stock our sambal? We reply within a day.',
- 'email' => 'hello@example.com',
- 'phone' => '+60 12-345 6789',
- 'whatsapp' => '60123456789',
- 'address' => 'Shah Alam, Selangor',
- ],
- ],
- [
- 'id' => 'footer',
- 'type' => 'footer',
- 'variant' => 'simple',
- 'content' => [
- 'text' => "© $name. All rights reserved.",
- 'links' => [
- ['label' => 'Shop', 'href' => '#products'],
- ['label' => 'FAQ', 'href' => '#faq'],
- ['label' => 'Contact', 'href' => '#contact'],
- ],
- ],
- ],
- ],
- ];
- }
- }
|