路线 [admin/CountryController.store] 未在 Laravel 中定义
Route [admin/CountryController.store] not defined in Laravel
我的 CountryController
在具有 store
功能的管理文件夹中。
Web.php
是:-
Route::prefix('admin')->group(function () {
Route::resource('country', 'admin\CountryController');});
HTML 代码为:-
<form method="post" action="{{ route('admin/CountryController.store') }}">
显示错误:- Route [admin/CountryController.store] not defined. (View: C:\xampp\htdocs\happyvivah\resources\views\admin\country.blade.php)
在CMD中使用'php artisan route:list'命令。它将显示所有路线的名称。它将显示路线名称 'country.store'.
因此,在将 route('admin/CountryController.store') 替换为 route('country.store') 后,它将起作用。
我的 CountryController
在具有 store
功能的管理文件夹中。
Web.php
是:-
Route::prefix('admin')->group(function () {
Route::resource('country', 'admin\CountryController');});
HTML 代码为:-
<form method="post" action="{{ route('admin/CountryController.store') }}">
显示错误:- Route [admin/CountryController.store] not defined. (View: C:\xampp\htdocs\happyvivah\resources\views\admin\country.blade.php)
在CMD中使用'php artisan route:list'命令。它将显示所有路线的名称。它将显示路线名称 'country.store'.
因此,在将 route('admin/CountryController.store') 替换为 route('country.store') 后,它将起作用。