I have a system where you go to http://example.com/restaurant/restaurant-key-example and you can view a given restaurant. I have a form at the bottom with reviews that can be added to the restaurant.
//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']) }}
and when I submit it, it goes to http://example.com/restaurant/key?restaurant-key-example. Is their any good way I can do this? What am I doing wrong? Any and all help is appreciated!
First should never post any forms and data with GET, but POST. This means you have to rework your route to Route::post('....');
After that you dont need that parameter in there! In your method in that controller you need to check for all the inputs by this:
$inputs = Input::except('_token');
and var_dump it if you want to check what you have posted!
Regards and tell me if you need any further help!
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments