【问题标题】:Route Not Defined - Blade Laravel未定义路线 - Blade Laravel
【发布时间】: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 这个命令有效。谢谢,请将此作为答案发布。

标签: php laravel


【解决方案1】:

您可以使用php artisan route:list 显示已注册路线的列表 - 确保它显示在那里。如果没有,请使用php artisan route:clear 清除 Laravel 的路由缓存

【讨论】:

    猜你喜欢
    • 2018-10-15
    • 2023-03-29
    • 1970-01-01
    • 2016-01-24
    • 2020-05-03
    • 2016-04-02
    • 2014-09-20
    • 2020-07-26
    • 2016-04-04
    相关资源
    最近更新 更多