I have a ConferencesController
with store
method. In my view, I POST to conferences.store
and I do my validation logic and Redirect::to
in the store
method.
public function store()
{
$validator = Validator::make(Input::all(), Conference::$rules);
if($validator->fails()){
Redirect::back()->with('message', 'Er ging iets mis, zie de errors hieronder.')->withErrors($validator)->withInput();
} else {
$conference = new Conference();
$conference->title = Input::get('title');
$conference->description = Input::get('description');
$conference->location = Input::get('location');
$conference->plannedTime = Input::get('plannedTime');
$conference->save();
}
}
The validation might fail, or not, but the controller does not do the Redirect::to
, is this a known problem? How do I solve it?