I am trying to do a create functionality where if a user accepts the terms and condition, it would go to page where the user can fill up something but when I try to click the button for terms and conditions, it would give me this error:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'title' cannot be null (SQL: insert into `reserves` (`title`, `lastname`, `firstname`, `middlename`, `birthday`, `city`, `streetadd`, `zipcode`, `country`, `home`, `work`, `fax`, `mobile`, `email`) values (, , , , , , , , , , , , , ))
I couldn't get through the page. I couldn't even get to the form page where you get to fill up things. How come this happen? What step should I make to make this work?
Here are my codes:
Routes:
Route::get('/','OnewayflightController@index');
Route::get('flight/onewayflight','OnewayflightController@onewayflight');
Route::post('flight/onewayflight','OnewayflightController@onewayflightresults');
Route::post('flight/onewayflightresults','OnewayflightController@onewayflightterms');
Route::post('flight/onewayflightterms','OnewayflightController@onewayflightfillup');
OnewayflightController.php
public function onewayflightterms()
{
return View::make('content.onewayflightterms');
}
public function onewayflightfillup()
{
$reserve = new Reserves;
$reserve->title = Input::get('title');
$reserve->lastname = Input::get('lastname');
$reserve->firstname= Input::get('firstname');
$reserve->middlename = Input::get('middlename');
$reserve->birthday = Input::get('birthday');
$reserve->city = Input::get('city');
$reserve->streetadd = Input::get('streetadd');
$reserve->zipcode = Input::get('zipcode');
$reserve->country = Input::get('country');
$reserve->home = Input::get('home');
$reserve->work = Input::get('work');
$reserve->fax = Input::get('fax');
$reserve->mobile = Input::get('mobile');
$reserve->email = Input::get('email');
$reserve->save();
}
var_dump(Input::all())
first, cause it seems like you get no values from your inputs – Danny