0
我在处理发布数据时遇到问题。Laravel 5收集发布数据
举例来说,如果我有一个简单的小形式:
<form action='/leads/getpost' method='POST'>
<input type='text' name='Domain'>
<input type='submit' name='submit'>
,然后收集数据,并尝试呼应出来:
public function getPost()
{
$formData = Request::all() ;
var_dump($formData);
//
}
我得到一个错误:在MethodNotAllowedHttpException RouteCollection.php 218行:
如果我使用GET做同样的事情,它工作正常。
我尝试过编辑VerifyCsrfToken并补充说:
protected $except = [ 'leads/getpost'
//
];
仍然没有工作。
http://stackoverflow.com/questions/32718870/how-to-get-all -input-of-post-in-laravel-5 –
@LeszekRepie,我试过这些例子,仍然没有工作 – Matt
https://laracasts.com/discuss/channels/laravel/methodnotallowedhttpexception-in-routecollectionphp-line-218? –