I have made a form on home page in hello.blade.php file , with form value
{{ Form::open(array('route' => 'home/addguest',
'class' => "form-horizontal")) }}
I have defined a method named addGuest()
in HomeController
which adds values in database and sends email.
I am getting error on home page as
ErrorException Route [home/addguest] not defined. (View: /var/www/laravel/app/views/hello.blade.php)
Route.php has
Route::post('Home/addGuest', array('uses' => 'HomeController@addGuest'));
Route::get('/home', function()
{
return View::make('home');
});
What value shall I define in form attribute to post this data and save that in the database?
Shall I change the form post target or shall I change the homecontroller
method?