this is how i check login or not
@if(Auth::user())
<p>Welcome {{ Auth::user()->Staff_id;}} </p>
</br>
@include('Component.logout')
</br>
@else
<P>not login yet</P>
@endif
try this code
$userlogin = [
'Staff_id' => Input::get('staff_id'),
'password' => Input::get('password')
];
if (Auth::attempt($userlogin)) {
return View::make('home')
} else {
return Redirect::route('log-in');
->with('msg', 'Login failed , no Account found!')
->withInput();
}
make sure that the columns in the user table named "Staff_id" and "password". You don't need to save the authentification in a session var... you can always use \Auth::XXX e.g. \Auth::check() or \Auth::user-()>Staff_id
Thanks , after i checking in my model i used for auth , i found the source problem in there and i already fix.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community