浏览代码

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
     }

正在加载...
取消
保存