【发布时间】:2018-10-15 16:31:42
【问题描述】:
路由器:
Route::post('/submit/{id}', function() {
return 'Hello World';
});
HTML:
<form method="POST" action="/submit/{{$id}}">
以上将URL改为http://127.0.0.1:8000/submit/$id并返回
页面因不活动而过期。
看起来 Laravel 正试图将 POST 强制转换为 GET。
【问题讨论】:
-
Page has expired的这个答案:stackoverflow.com/a/46141940/9613505 -
我认为您在 POST 请求中使用了 get 类型路由。检查这个Route Parameters
-
@Hussein,谢谢,工作
-
@seamus 我认为 html 中的
$id未解析,您确定 html 名称类似于:example.blade.php吗?
标签: laravel post get routing laravel-5.4