Browse Source

modal to show all speech

master
farhan 4 months ago
parent
commit
2cb968d35e

+ 2
- 1
app/Http/Controllers/MainController.php View File

@@ -12,10 +12,11 @@ class MainController extends Controller
12 12
         $rsvp = RSVP::all();
13 13
         $guestbooks = GuestBook::orderBy('created_at', 'desc')->take(5)->get();
14 14
         $totalPages = $guestbooks->count();
15
+        $allguestbooks = GuestBook::all();
15 16
 
16 17
         $host = $request->getHost();
17 18
 
18
-        return view('digital-card', compact(['rsvp', 'guestbooks', 'totalPages', 'host']));
19
+        return view('digital-card', compact(['rsvp', 'guestbooks', 'totalPages', 'host', 'allguestbooks']));
19 20
     }
20 21
 
21 22
     public function saveRsvp(Request $request) {

+ 7
- 3
resources/views/components/guestbook.blade.php View File

@@ -10,12 +10,15 @@
10 10
             @endfor
11 11
         </div>
12 12
     </div>
13
-    <div class="text-center pb-2 fade-element">
13
+    <div class="text-center flex justify-center pb-2 gap-2 fade-element">
14 14
         <a onclick="guestbook.showModal()" class="rounded-full border-solid border-2 border-navbarcolor py-1 px-3 font-medium text-gray-600">
15 15
             <i class="fa-solid fa-pen-fancy"></i>
16
-            <span>Ucapan</span>
16
+            <span>Beri Ucapan</span>
17
+        </a>
18
+        <a onclick="allguestbook.showModal()" class="rounded-full border-solid border-2 border-navbarcolor py-1 px-3 font-medium text-gray-600">
19
+            <i class="fa-solid fa-eye"></i>
20
+            <span>Lihat Ucapan</span>
17 21
         </a>
18
-
19 22
     </div>
20 23
     <div class="text-center pb-2 fade-element">
21 24
         <a onclick="rsvp.showModal()" class="rounded-full border-solid border-2 border-navbarcolor py-1 px-3 font-medium text-gray-600">
@@ -25,6 +28,7 @@
25 28
     </div>
26 29
     <hr class="border-t-1 border-gray-300 mt-5 mb-3 w-4/5 self-center fade-element">
27 30
     @include('modals.guestbook-modal')
31
+    @include('modals.show-all-guestbook')
28 32
 </div>
29 33
 
30 34
 @push('script')

+ 15
- 0
resources/views/modals/show-all-guestbook.blade.php View File

@@ -0,0 +1,15 @@
1
+<dialog id="allguestbook" class="modal">
2
+    <div class="modal-box w-11/12 max-w-5xl">
3
+      <h3 class="text-lg font-bold">Semua Ucapan</h3>
4
+      @foreach ($allguestbooks as $allguestbook)
5
+          <p>{{$allguestbook->name}}</p>
6
+          <p>{{$allguestbook->speech}}</p>
7
+          <hr class="border-t-1 border-gray-300 my-5 w-4/5 self-center ">
8
+      @endforeach
9
+      <div class="modal-action">
10
+        <form method="dialog">
11
+            <button class="btn">Tutup</button>
12
+        </form>
13
+      </div>
14
+    </div>
15
+</dialog>

Loading…
Cancel
Save