Answer the question
In order to leave comments, you need to log in
Validation not working?
AuthController
public function postLogin()
{
$data = Input::all();
$rules = array(
'username' => 'required',
'password' => 'required',
);
$validator = Validator::make($data, $rules);
if ($validator->fails()) {
return redirect(route('postLogin'))->withErrors($validator)->withInput();
}
}
@extends('todo.layouts.default')
@section('content')
Login
@foreach($errors->all as $error)
<div class="errors">{{ $error[0] }}</div>
@endforeach
{!! Form::open() !!}
<input type="text" name="username" placeholder="UserName"/>
<input type="text" name="password" placeholder="passowrd"/>
<button type="submit">Отправить</button>
{!! Form::close() !!}
@endsection
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question