Laravel 4 Form Post
laravel, laravel-4, php
Solution
For POST looks like you need to change it to:
{{ Form::open(array('action' => 'NewQuoteController@quote')) }}
And you need to have a route to your controller action:
Route::post('quote', 'NewQuoteController@quote');
Default method for `Form::open()` is POST, but if you need to change it to PUT, for example, you will have to
{{ Form::open(array('method' => 'PUT', 'action' => 'NewQuoteController@quote')) }}
And you'll have to create a new route for it too:
Route::put('quote', 'NewQuoteController@quote');
You also have to chage
$name = Input::post('ent_mileage');
to
$name = Input::get('ent_mileage');
You can use the same url for the different methods and actions:
Route::get('/newquote','NewQuoteController@vehicledetails');
Route::post('/newquote', 'NewQuoteController@quote');
Route::put('/newquote', 'NewQuoteController@quoteUpdate');
Problem
Im currently in the process of learning Laravel 4. I'm trying to create a really simple post form, here is my code for the opening of the form: ``` {{ Form::open(array('post' => 'NewQuoteController@quote')) }} ``` And then within my NewQuoteController i have the following: ``` public function quote() { $name = Input::post('ent_mileage'); return $name; } ``` I keep getting the following error: Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException It's probably something really stupid... Thanks. EDIT This is what I have in my routes.php ``` Route::get('/newquote','NewQuoteController@vehicledetails'); Route::post('/newquote/quote', 'NewQuoteController@quote'); ```