Postingan lainnya
Laravel Login Auth Error
Ini kenapa ya gan ? kok yang kedetect cuman username aja ? password enggak --"
{!! Form::open(array('action' => 'AdminController@postSignIn', 'method' => 'post')) !!}
{!! csrf_field() !!}
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
<label class="sr-only" for="inputEmail">Username</label>
<input type="text" class="form-control" id="inputEmail" name="username" placeholder="Username" autocomplete="off">
@if ($errors->has('username'))
<span class="help-block">
<strong>{{ $errors->first('username') }}</strong>
</span>
@endif
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label class="sr-only" for="inputPassword">Password</label>
<input type="password" class="form-control" id="inputPassword" name="password" placeholder="*************" autocomplete="off">
@if($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
<div class="form-group clearfix">
<div class="checkbox-custom checkbox-inline pull-left">
<input type="checkbox" id="inputCheckbox" name="checkbox">
<label for="inputCheckbox">Remember me</label>
</div>
<a class="pull-right" href="forgot-password.html">Forgot password?</a>
</div>
<button type="submit" class="btn btn-primary btn-block">Sign in</button>
{!! Form::close() !!}
16 Jawaban:
coba pake Request
example :
use Illuminate\Http\Request;
public function postSignIn(Request $request) {
$pass= $request->input('password');
}
coba di debug. pake IDE atau text editor biasa seperti nodepad++ atau sublime text ?
coba itu passwordnya di enkripsi pake Hash::make('pass');
dirimu edit bawaan fungsi login dari laravel?, klo iya. balikin kaya awal dan enkrip passwordnya pake Hash::make(password);
'password' => Hash::make(Input::get('password'))
Ini buat method sendiri atau udh ada sblmnya alias bawaan laravel?
mending check dlu itu seblm Auth::attempt, apakah username dan passwordnya udah dapet atau blm
checkout : https://laravel.com/docs/5.2/authentication#authenticating-users
kalo kita bikin method baru dan menggunakan Auth::attempt() apakah bisa ?
<div>di dd() padahal ada isinya lho gan<br>tetep kok salah ya<br><br></div>