瀏覽代碼

use host

am
farhan 4 月之前
父節點
當前提交
aaadac9d26
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      app/Http/Controllers/MainController.php

+ 3
- 3
app/Http/Controllers/MainController.php 查看文件

@@ -12,12 +12,12 @@ class MainController extends Controller
12 12
         $rsvp = RSVP::all();
13 13
         $guestbook = GuestBook::all();
14 14
 
15
-        $currentUrl = $request->fullUrl();
16
-        if ($currentUrl == 'https://aliffayuna.com/') {
15
+        $host = $request->getHost();
16
+        if ($host == 'aliffayuna.com') {
17 17
             return view('digital-card', compact(['rsvp', 'guestbook']));
18 18
         }
19 19
 
20
-        if ($currentUrl == 'https://rsvp.aliffayuna.com/') {
20
+        if ($host == 'rsvp.aliffayuna.com') {
21 21
             return view('rsvp-digital-card');
22 22
         }
23 23
     }

Loading…
取消
儲存