Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 4-如何提交表单以向带有URL变量的页面添加注释?_Php_Html_Forms_Laravel_Routing - Fatal编程技术网

Php Laravel 4-如何提交表单以向带有URL变量的页面添加注释?

Php Laravel 4-如何提交表单以向带有URL变量的页面添加注释?,php,html,forms,laravel,routing,Php,Html,Forms,Laravel,Routing,我有一个系统,你可以去,你可以查看给定的餐厅。我在底部有一个表格,上面有可以添加到餐厅的评论 //Restaurant info page(GET) Route::get('/restaurant/{key}', array( 'as' => 'restaurant-show', 'uses' => 'RestaurantController@getRestaurant' )); //Restaurant review submit(POST) Route::get

我有一个系统,你可以去,你可以查看给定的餐厅。我在底部有一个表格,上面有可以添加到餐厅的评论

//Restaurant info page(GET)
Route::get('/restaurant/{key}', array(
    'as' => 'restaurant-show',
    'uses' => 'RestaurantController@getRestaurant'
));

//Restaurant review submit(POST)
Route::get('/restaurant/review/{key}', array(
    'as' => 'restaurant-review-post',
    'uses' => 'RestaurantController@postAddReview'
))->before('csrf');
{{Form::open(['route'=>'RestaurantController@postAddReview“])}
当我提交它时,它会转到。他们有什么好办法可以让我这么做吗?我做错了什么?
感谢您的任何帮助

First不应使用GET发布任何表单和数据,而应使用post。这意味着您必须修改路由到
route::post(“…”)

在那之后,你不需要那个参数!在该控制器的方法中,您需要通过以下方式检查所有输入:

$inputs = Input::except('_token');
如果你想查看你发布的内容,请将其转储


问候并告诉我,如果你需要任何进一步的帮助

这里没有足够的代码来帮助你,太多的缺失部分。非常感谢!我想我只是试图修复它,让自己陷入更深的麻烦中,这就是为什么我为表单处理程序执行Route::get。谢谢!我很高兴我能帮忙!如果您需要进一步帮助,请给我任何反馈!别忘了投票^_^