php - Laravel 登录和注册页面不起作用
问题描述
安装 laravel 7 版本后,我立即安装ui: auth
,运行php artisan ui bootstrap --auth
命令(使用引导标记进行安装)。最初一切正常,我没有遇到任何问题,但现在进入页面(登录、注册、重置密码)时出现 404 错误。
web.php(路由文件)
<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', 'MainController@index')->name('main');
Route::get('price', 'WorksController@index')->name('price');
Route::get('price/{slug}', 'WorksController@show')->name('single');
Route::get('about', 'AboutController@index')->name('about');
Route::get('news', 'NewsController@index')->name('news');
Route::get('news/{slug}', 'NewsController@show')->name('news_single');
Route::get('contact', 'ContactsController@index')->name('contacts');
Route::post('contact/send', 'MailSetting@send_form');
Route::get('/home', 'HomeController@index')->name('home');
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
我没有改变任何东西,就在Auth::routes();
我开始编写我的控制器和它们的路径之前。现在,如果我在 VCC(代码)中运行它,那么Auth::routes();
在行上它说找不到该功能,但是如果我在 VCS(Studio)中打开相同的东西,那么这个错误就不再存在了。并且在调用php artisan route:list
命令时,没有登录、密码、注册页面的路径。
解决方案
推荐阅读
- javascript - 如何使用 JQuery UI 在提交表单时显示确认对话框
- reactjs - 我可以从远程服务器或通过从互联网加载的脚本标签提供 js 包(webpack)吗?
- mule-studio - MUnit Coverage 未显示异常块覆盖率
- android - Dexguarded Android 库缺少 SO 文件
- c# - c#逆变和协变:不能从实现转换为接口
- python-3.x - 创建猜数字游戏
- python - python 解析日志文件:在不同的行中找到两个特定的字符串并连接到一个并写入另一个文件!避免空行
- c++ - 确保流程关闭
- c++ - gdb、C++、codelite:调试共享库时行号错误
- python - 运动物体在不应该加速时加速