Wedding Invitation
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

MainController.php 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use App\Models\RSVP;
  5. use App\Models\GuestBook;
  6. class MainController extends Controller
  7. {
  8. public function main(Request $request) {
  9. $rsvp = RSVP::all();
  10. $guestbook = GuestBook::all();
  11. $currentUrl = $request->fullUrl();
  12. dd($currentUrl);
  13. if ($currentUrl == 'https://aliffayuna.com/') {
  14. return view('digital-card', compact(['rsvp', 'guestbook']));
  15. }
  16. if ($currentUrl == 'https://rsvp.aliffayuna.com/') {
  17. return view('rsvp-digital-card', compact(['rsvp', 'guestbook']));
  18. }
  19. }
  20. public function saveRsvp(Request $request) {
  21. RSVP::create([
  22. 'name' => $request->name,
  23. 'member' => $request->member,
  24. 'phone' => $request->phone
  25. ]);
  26. session()->flash('success', 'Terima kasih kerana sudi menghadirkan diri!');
  27. return response()->json(['message' => 'RSVP form submitted successfully']);
  28. }
  29. public function saveSpeech(Request $request) {
  30. GuestBook::create([
  31. 'name' => $request->name,
  32. 'speech' => $request->speech
  33. ]);
  34. session()->flash('success', 'Terima kasih atas ucapan anda!');
  35. return response()->json(['message' => 'Speech form submitted successfully']);
  36. }
  37. public function rsvpmain() {
  38. return view('rsvp-digital-card');
  39. }
  40. }