Symfony\Component\Routing\Exception\RouteNotFoundException

Symfony\Component\Routing\Exception\RouteNotFoundException

提问人:M.Koops 提问时间:4/9/2021 更新时间:4/9/2021 访问量:1042

问:

弹出错误 Symfony\Component\Routing\Exception\RouteNotFoundException,

然而,我确实有这条命名的路线......

/* ADMIN SECTION */
Route::prefix('admin')->name('admin/')->group(function () {
    Route::group(['middleware' => ['auth']], function(){
        Route::get('fill_contraband', 'ContrabandController@fillContraband');
        
        Route::get('/', function(){ return dashboard(); });
        
        Route::get('dashboard', function(){ return dashboard(); });
        
            Route::name('users.')->group(function() {
            Route::get('users', 'gameUserController@showUserList');
            Route::get('users/create', 'gameUserController@createUser');
            Route::post('users/create', 'gameUserController@handleCreateUser');
            Route::get('users/edit/{id}', 'gameUserController@editUser');
            Route::post('users/edit/{id}', 'gameUserController@handleEditUser');
            Route::get('users/delete/{id}', 'gameUserController@deleteUser');
            Route::get('users/bulk_create', 'GameUserBulkUploadController@index');
            Route::post('users/bulk_create/import', 'GameUserBulkUploadController@importGameUsers');
            Route::post('users/bulk_create/do_import', 'GameUserBulkUploadController@executeImportGameUsers');
            Route::get('users/edit_score/{id}', 'gameUserController@editScore');
            Route::post('users/edit_score/{id}', 'gameUserController@handleEditScore');
            Route::post('users/sendBulkEmail', 'gameUserController@sendBulkEmail')->name('sendBulkEmail');
        });

这是我使用的最后一个名为 Route 'sendBulkEmail' 的路由,从视图中引用:

<form method="POST" action="{{ route('sendBulkEmail') }}">

我做错了什么??

拉拉维尔-8 命名路由

评论

0赞 Nico Haase 4/9/2021
您是否尝试过转储配置的路由?
0赞 M.Koops 4/9/2021
路由列表显示:当我在 blade.pho 中更改路由时,我收到错误:Route [admin/users.sendBulkEmail ] not defined。auth | | | POST | admin/users/send-bulk-email | admin/users.sendBulkEmail | App\Http\Controllers\gameUserController@sendBulkEmail |
0赞 Prospero 4/9/2021
users.sendBulkEmail ?
0赞 M.Koops 4/10/2021
发现了一个愚蠢的错别字......<form method=“POST” action=“{{ route('admin/users.sendBulkEmail') }}”>现在可以工作了。仍然想知道为什么命名的路线不起作用......

答: 暂无答案