我正在创建一个 Laravel 电子商务应用程序。我在 youtube 上关注本教程:https ://www.youtube.com/watch?v=L3EbWJmmyjo&list=PLEhEHUEU3x5oPTli631ZX9cxl6cU_sDaR&index=18
对于网站的管理部分,我使用的是 Voyager。在我的本地主机上,一切似乎都运行良好:
登陆页面(http://localhost:8000):
然后当我输入链接:http://localhost:8000/admin 时,它会将我带到 http://localhost:8000/admin/login:
然后我输入这些凭据(图像也显示数据库)。如您所见,凭据匹配,当我按下登录时,我被带到仪表板:
到目前为止所有的屏幕截图都在我的本地主机上。当我尝试在我的实时网站上安装 Voyager 时,它停止工作!这是我的实时网址:https ://janinevalerieaesthetics.com
我正在使用 Forge 和 Envoyer 进行托管。他们正在使用我的 GitLab 帐户进行链接:https ://gitlab.com/rossi99/salonwebsite
我使用 ssh 通过我的终端使用以下链接连接到我的 Forge 服务器:ssh forge@janinevalerieaesthetics.com
然后我一直 cd 进入当前目录(包含我所有文件夹的目录,包括“供应商”文件和“工匠”),然后我使用 php artisan 命令安装 voyager 包(https://voyager- docs.devdojo.com/getting-started/installation):
- 更改 .env 文件:
安装步骤:
APP_URL=http://localhost
我的.env:
APP_URL=https://janinevalerieaesthetics.com
安装步骤:
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
我的.env:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=forge
DB_USERNAME=forge
DB_PASSWORD="**************"
我从我的终端 forge@salonWebsite:~/janinevalerieaesthetics.com/current$ 运行这个命令:
php artisan voyager:install
然后我使用这个命令从同一个终端创建一个用户:
php artisan voyager:admin your@email.com --create
这是我的实时数据库表:
这是角色表(您可以看到 ID 为 1 的用户是管理员):
但是当我导航到https://janinevalerieaesthetics.com/admin/login时,它会显示登录屏幕:
但是,当我使用正确的凭据登录时,它不是让我登录并显示管理仪表板,而是让我登录并带我进入登录页面,当我尝试手动登录时,它只会将我重定向到登录页面页: