So, i started with laravel. Tried with making a form post to the same page. Here's what i have so far,
routes.php
Route::get('/', 'HomeController@showWelcome');
Route::group(array('before' => 'csrf'), function () {
Route::post('contactus', 'HomeController@sendEmail');
});
hello.php
<?php echo Form::open(array('action' => 'HomeController@sendEmail'))?>
input fields here
<?php echo Form::close() ?>
HomeController
public function showWelcome()
{
return View::make('hello');
}
public function sendEmail()
{
print_r($_POST);exit;
}
Problem: Form gets posted to the url public/contactus
Can someone point out which really stupid thing, i am doing?