我有一个master.php
文件包含may laravel项目的一些路线。像这样:
Route::group([
'prefix' => 'master',
'as' => 'master.'
], function () {
Route::get('/login', 'MasterController@showLoginForm');
Route::post('/login', 'MasterController@masterDoLogin');
Route::group([
'middleware' => ['auth:master']
], function () {
Route::get('dashboard', ['as' => 'admin_dashboard', 'uses' => 'DashboardController@index']);
Route::group(['prefix' => 'websites', 'as' => 'websites.'], function () {
Route::get('websitesDatatable', ['as' => 'websitesDatatable', 'uses' => 'WebsiteController@websitesDatatable']);
});
Route::resource('websites', 'WebsiteController');
});
});
在以下php artisan route:list
处运行的路线后,显示一切正确:
| GET|HEAD | master/dashboard | master.admin_dashboard | App\Http\Controllers\DashboardController@index | web,auth:master |
| | POST | master/login | master. | App\Http\Controllers\MasterController@masterDoLogin | web |
| | GET|HEAD | master/login | master. | App\Http\Controllers\MasterController@showLoginForm | web |
| | POST | master/websites | master.websites.store | App\Http\Controllers\WebsiteController@store | web,auth:master |
| | GET|HEAD | master/websites | master.websites.index | App\Http\Controllers\WebsiteController@index | web,auth:master |
| | GET|HEAD | master/websites/create | master.websites.create | App\Http\Controllers\WebsiteController@create | web,auth:master |
| | GET|HEAD | master/websites/websitesDatatable | master.websites.websitesDatatable | App\Http\Controllers\WebsiteController@websitesDatatable | web,auth:master |
| | DELETE | master/websites/{website} | master.websites.destroy | App\Http\Controllers\WebsiteController@destroy | web,auth:master |
| | PUT|PATCH | master/websites/{website} | master.websites.update | App\Http\Controllers\WebsiteController@update | web,auth:master |
| | GET|HEAD | master/websites/{website} | master.websites.show | App\Http\Controllers\WebsiteController@show | web,auth:master |
| | GET|HEAD | master/websites/{website}/edit | master.websites.edit | App\Http\Controllers\WebsiteController@edit | web,auth:master
master/websites
,master/websites/create
,master/websites/websitesDatatable
等路线运行正常。
但其他路线如master/websites/1
或master/websites/1/edit
无法识别,并始终返回 404 not found 错误。
我不知道是什么问题?
如果有人知道,请帮助我。