我有此管理路由:Route::group([ 'namespace' => 'Auth',], function () { // Authentication Routes... Route::get('login', 'LoginController@showLoginForm')->name('login_page'); Route::post('login', 'LoginController@login')->name('login'); Route::post('logout', 'LoginController@logout')->name('logout');});Route::group([ 'middleware' => [ 'auth:admin', ],], function () { // for all admins Route::get('/', 'AdminController@index')->name('dashboard'); Route::get('home', 'AdminController@index')->name('dashboard'); Route::get('dashboard', 'AdminController@index')->name('dashboard'); // for administrator // users Route::group(['prefix' => 'users', 'as' => 'users.',], function () { Route::get('all', 'UserController@index')->name('index'); Route::get('ajax', 'UserController@ajax')->name('ajax'); Route::get('create', 'UserController@create')->name('create'); Route::post('post', 'UserController@store')->name('store'); Route::get('show/{id}', 'UserController@show'); // ->where('id', '[0-9]+'); Route::post('change_status', 'UserController@change_status')->name('change_status'); Route::post('delete', 'UserController@delete')->name('delete'); });});我需要对商店数据进行操作表单:create.blade<form method="POST" action="{{ route('users.store') }}">但在行动中,我看到这个错误:> “未定义路线 [users.store]。(查看: C:\xampp\htdocs\laravel-multiauth\resources\views\admin\pages\users\create.blade.php)”未在用户组路由中定义的路由器的名称。我该如何修复?
3 回答
天涯尽头无女友
TA贡献1831条经验 获得超9个赞
我没有看到任何问题。最快的答案是跑,看看你的路线是否存在php artisan route:list
如果它存在并且没有问题,那么运行,如果它不起作用,那么我必须看到整个文件php artisan route:clear
web.php
- 3 回答
- 0 关注
- 123 浏览
添加回答
举报
0/150
提交
取消