【发布时间】:2020-10-28 13:21:01
【问题描述】:
我的问题与this one 类似,但解决方案不起作用。
路线 [postThisAppraisal] 未定义。 (查看:C:\xampp\htdocs\laraveladmin\resources\views\admin\appraisals\fillAppraisal.blade.php)
我在 web.php 中的路由如下:(没有任何命名空间)
Route::post('/postThisAppraisal', 'PublicController@postThisAppraisal')->name('postThisAppraisal');
在blade.php中我这样称呼它:
<form action="{{ route("postThisAppraisal") }}" method="POST" enctype="multipart/form-data">
我什至在PublicController 中定义如下:
public function postThisAppraisal(){
return "submitted";
}
【问题讨论】:
-
使用
php artisan route:list显示您的路线并确保它在那里。尝试php artisan route:clear清除路由缓存。 -
php artisan route:clear 这个命令有效。谢谢,请将此作为答案发布。