Website undangan sekarang mendukung multiple templates dengan routing berbeda. User dapat memilih template yang sesuai dengan tema pernikahan mereka.
resources/views/
├── home.blade.php # Template selector homepage
├── components/ # Shared components
│ ├── animated-background.blade.php
│ ├── wave-divider.blade.php
│ ├── decorative-ornament.blade.php
│ └── section-animated.blade.php
└── templates/
├── template-1/ # Elegant Modern
│ ├── index.blade.php
│ └── sections/
│ ├── gallery.blade.php
│ ├── gift.blade.php
│ └── guestbook.blade.php
└── template-2/ # Classic Romantic
├── index.blade.php
└── sections/
├── couple.blade.php
├── story.blade.php
├── event.blade.php
├── gallery.blade.php
├── gift.blade.php
└── rsvp.blade.php
GET / → home.blade.php
Template selector page dengan preview kedua template.
GET /template-1 → templates.template-1.index
POST /template-1/rsvp → rsvp.store
GET /template-2 → templates.template-2.index
POST /template-2/rsvp → rsvp.store
GET /invitation → redirect ke /template-1
| Feature | Template 1 (Elegant Modern) | Template 2 (Classic Romantic) |
|---|---|---|
| Style | Modern, Clean, Techy | Classic, Romantic, Floral |
| Color Scheme | Primary Blue + Gold | Rose Pink + Soft Colors |
| Animations | Scroll-triggered, Glassmorphism | Floral animations, Soft transitions |
| Hero | Gradient with blobs | Floral background with hearts |
| Sections | Gallery, Gift, Guest Book | Couple, Story, Event, Gallery, Gift |
| Ornaments | Geometric shapes | Floral hearts |
| Navigation | Bottom slider nav | Bottom slider nav |
| Best For | Modern weddings, Tech-savvy couples | Traditional weddings, Romantic themes |
class InvitationController extends Controller
{
// Homepage - Template Selector
public function home()
{
return view('home');
}
// Template 1
public function template1()
{
$data = $this->getInvitationData();
return view('templates.template-1.index', $data);
}
// Template 2
public function template2()
{
$data = $this->getInvitationData();
return view('templates.template-2.index', $data);
}
// Shared data untuk semua template
private function getInvitationData()
{
return [
'eventDate' => '2025-12-31 19:00:00',
'confirmedGuests' => Guest::where('is_confirmed', true)->count(),
'wishes' => Guest::whereNotNull('message')->latest()->paginate(10),
// ... etc
];
}
}mkdir -p resources/views/templates/template-3/sectionstouch resources/views/templates/template-3/index.blade.phpEdit routes/web.php:
Route::prefix('template-3')->name('template3.')->group(function () {
Route::get('/', [InvitationController::class, 'template3'])->name('index');
Route::post('/rsvp', [GuestController::class, 'store'])->name('rsvp.store');
});Edit app/Http/Controllers/InvitationController.php:
public function template3()
{
$data = $this->getInvitationData();
return view('templates.template-3.index', $data);
}Edit resources/views/home.blade.php dan tambahkan card untuk template 3.
- Hero/Opening - Full screen hero dengan animated background
- Salam - Greeting dan intro couple
- Gallery - Photo gallery dengan lightbox
- Gift - Bank transfer dan e-wallet info
- Event - Akad & Resepsi info dengan countdown
- Guest Book - Wedding wishes dari tamu
- Maps - Lokasi venue
- RSVP - Form konfirmasi kehadiran
- Hero/Opening - Floral hero dengan hearts
- Couple - Bride & Groom profile dengan floral frames
- Story - Love timeline/story
- Event - Event details dengan countdown
- Gallery - Romantic photo gallery
- Gift - Gift info dengan soft design
- RSVP - Attendance confirmation
Setiap template dapat memiliki component sendiri di folder sections/.
Contoh - Template 1:
@include('templates.template-1.sections.gallery')
@include('templates.template-1.sections.gift')Contoh - Template 2:
@include('templates.template-2.sections.couple')
@include('templates.template-2.sections.story')Components yang digunakan semua template:
<x-animated-background variant="rose" />
<x-wave-divider position="top" color="white" />
<x-decorative-ornament position="top-left" type="floral" color="gold" />// Primary blue color scheme
text-primary-600
bg-primary-500// Rose/pink color scheme
text-rose-600
bg-rose-500Semua templates menggunakan data yang sama dari getInvitationData():
$eventDate
$confirmedGuests
$totalCapacity
$wishes
$totalWishes
$attendingCount
$notAttendingCount
$totalGuestsData ini tersedia di semua template views.
// Homepage
route('home')
// Template 1
route('template1.index')
route('template1.rsvp.store')
// Template 2
route('template2.index')
route('template2.rsvp.store')<!-- Link to template 1 -->
<a href="{{ route('template1.index') }}">Template 1</a>
<!-- Link to template 2 -->
<a href="{{ route('template2.index') }}">Template 2</a>
<!-- Back to home -->
<a href="{{ route('home') }}">Choose Template</a>Primary: Blue (#0ea5e9, #0284c7)
Accent: Gold (#eab308, #ca8a04)
Background: White with gradient overlaysPrimary: Rose (#f43f5e, #e11d48)
Accent: Pink (#ec4899, #db2777)
Background: Soft rose/pink gradientsKedua template fully responsive dengan breakpoints:
- Mobile: < 640px
- Tablet: 640px - 1024px
- Desktop: > 1024px
npm run buildAkan compile assets untuk semua templates.
php artisan view:clear
php artisan route:clear
php artisan config:clear- Template cards tampil dengan benar
- Preview images/backgrounds muncul
- Links ke template 1 & 2 berfungsi
- Animations smooth
- All sections tampil
- Scroll animations berfungsi
- Bottom nav slider works
- RSVP form submit berhasil
- Gallery lightbox works
- All sections tampil
- Floral ornaments muncul
- Scroll animations smooth
- Bottom nav berfungsi
- RSVP form berhasil
- Chrome
- Firefox
- Safari
- Edge
- Mobile browsers
app/Http/Controllers/InvitationController.php
resources/views/home.blade.php
- resources/views/templates/template-1/index.blade.php
- resources/views/templates/template-2/index.blade.php
✅ 2 Templates tersedia:
- Template 1: Elegant Modern (Blue/Gold)
- Template 2: Classic Romantic (Rose/Pink)
✅ Homepage dengan template selector
✅ Routing dengan prefix (/template-1, /template-2)
✅ Shared components untuk consistency
✅ Shared data dari single controller method
✅ Easy to extend - tinggal copy template structure dan tambah route
✅ Fully responsive untuk semua devices
✅ Tested & ready untuk production