From default auth and register sistem that comes with Laravel 5.2,
Just made a simple view, that could be the welcome page, and to include the login and register forms.
At the moment, if any button is pressed, the validation checks and finds errors from both forms, and are highlighted all of them which are required.
So what is the best solution to include them and maybe a separate validation for each?
I tried to change the default login sistem to be different from the register form input names, but i think there is a chain, due to validation and adding input values into database.
<div class="form-group{{ $errors->has('login_email') ? ' has-error' : '' }}">
<label class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input type="email" class="form-control" name="login_email" value="{{ old('login_email') }}">
@if ($errors->has('login_email'))
<span class="help-block">
<strong>{{ $errors->first('login_email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('login_password') ? ' has-error' : '' }}">
<label class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input type="password" class="form-control" name="login_password">
@if ($errors->has('login_password'))
<span class="help-block">
<strong>{{ $errors->first('login_password') }}</strong>
</span>
@endif
</div>
</div>
As it can be seen, just changed the email and password input names from 'email' to 'login_email' and from 'password' to 'login_password'
Any quick and efficient solutions/ideas are welcome
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…