Support the ongoing development of Laravel.io →
Authentication Session
Last updated 2 years ago.
0

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
0

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

Last updated 9 years ago.
0

Thanks , after i checking in my model i used for auth , i found the source problem in there and i already fix.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

zquilong zquilong Joined 11 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.