In your controller something like:
$rules = array('username' => 'required', 'password' => 'required');
$v = Validator::make($input, $rules);
if($v->passes())
{ //do something }
else
{ return Redirect::to('/')->withInput()->withErrors($v);}
In the view:
{{ implode('', $errors->all('<li class="alert" style="color: #ffffff">:message</li>')) }}
I followed the tutorials (1-6) here to come up with this solution: https://www.youtube.com/watch?v=9MGBdy_Sqjg
{{ Form::text('link', Input::old('link'), ['class' => 'form-control']) }}
Many thanks to us!
I missed ->withInput() in the controller and I didn't know about the existence of Input::old().
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community