From 05343a5cb97402d726effccc163dbe4dddc522d7 Mon Sep 17 00:00:00 2001 From: Farhaan4 <127176994+Farhaan4@users.noreply.github.com> Date: Fri, 24 Oct 2025 17:05:32 +0700 Subject: [PATCH] rsvp --- .../Controllers/Api/GuestApiController.php | 2 +- .../app/Http/Controllers/RsvpController.php | 2 +- backend-baru/app/Models/Pelanggan.php | 13 + .../components/templates/wedding/Couple.vue | 532 +++++++++++ .../components/templates/wedding/Gallery.vue | 225 ++++- .../templates/wedding/GuestBook.vue | 283 ++++-- .../app/components/templates/wedding/RSVP.vue | 73 +- .../components/templates/wedding/WeddingA.vue | 861 ++++++++---------- .../undangan/undangan-pernikahan-premium.vue | 82 +- 9 files changed, 1455 insertions(+), 618 deletions(-) create mode 100644 proyek-frontend/app/components/templates/wedding/Couple.vue diff --git a/backend-baru/app/Http/Controllers/Api/GuestApiController.php b/backend-baru/app/Http/Controllers/Api/GuestApiController.php index 8dd9070..69faa4e 100644 --- a/backend-baru/app/Http/Controllers/Api/GuestApiController.php +++ b/backend-baru/app/Http/Controllers/Api/GuestApiController.php @@ -118,7 +118,7 @@ class GuestApiController extends Controller // Ambil undangan berdasarkan invitation code public function getByInvitationCode($code) { - $data = Guest::with('pelanggan.template') + $data = Guest::with('pelanggan.template', 'pelanggan.rsvp') ->where('kode_invitasi', $code) ->first(); diff --git a/backend-baru/app/Http/Controllers/RsvpController.php b/backend-baru/app/Http/Controllers/RsvpController.php index 1fef89a..f9080d7 100644 --- a/backend-baru/app/Http/Controllers/RsvpController.php +++ b/backend-baru/app/Http/Controllers/RsvpController.php @@ -33,7 +33,7 @@ class RsvpController extends Controller // ๐Ÿ”น Ambil semua RSVP berdasarkan kode undangan (GET) public function show($invitationCode) { - $pelanggan = Pelanggan::where('kode_invitasi', $invitationCode)->first(); + $pelanggan = Pelanggan::where('invitation_code', $invitationCode)->first(); if (!$pelanggan) { return response()->json(['message' => 'Kode undangan tidak ditemukan'], 404); diff --git a/backend-baru/app/Models/Pelanggan.php b/backend-baru/app/Models/Pelanggan.php index 30780a0..85c67b0 100644 --- a/backend-baru/app/Models/Pelanggan.php +++ b/backend-baru/app/Models/Pelanggan.php @@ -36,4 +36,17 @@ class Pelanggan extends Model { return $this->hasMany(Guest::class, 'id_pelanggan'); } + + public function rsvp() + { + return $this->hasManyThrough( + Rsvp::class, + Guest::class, + 'id_pelanggan', + 'guest_id', + 'id', + 'id' + ); + } + } diff --git a/proyek-frontend/app/components/templates/wedding/Couple.vue b/proyek-frontend/app/components/templates/wedding/Couple.vue new file mode 100644 index 0000000..1021cb7 --- /dev/null +++ b/proyek-frontend/app/components/templates/wedding/Couple.vue @@ -0,0 +1,532 @@ + + + + + + \ No newline at end of file diff --git a/proyek-frontend/app/components/templates/wedding/Gallery.vue b/proyek-frontend/app/components/templates/wedding/Gallery.vue index fceaeab..81082ca 100644 --- a/proyek-frontend/app/components/templates/wedding/Gallery.vue +++ b/proyek-frontend/app/components/templates/wedding/Gallery.vue @@ -1,58 +1,197 @@ + + \ No newline at end of file diff --git a/proyek-frontend/app/components/templates/wedding/GuestBook.vue b/proyek-frontend/app/components/templates/wedding/GuestBook.vue index e52c2fa..73bcfd5 100644 --- a/proyek-frontend/app/components/templates/wedding/GuestBook.vue +++ b/proyek-frontend/app/components/templates/wedding/GuestBook.vue @@ -1,63 +1,153 @@ + + \ No newline at end of file diff --git a/proyek-frontend/app/components/templates/wedding/RSVP.vue b/proyek-frontend/app/components/templates/wedding/RSVP.vue index 7d128d6..4af137b 100644 --- a/proyek-frontend/app/components/templates/wedding/RSVP.vue +++ b/proyek-frontend/app/components/templates/wedding/RSVP.vue @@ -1,15 +1,19 @@ + \ No newline at end of file