Thursday, March 1, 2018

Laravel default User login Code | laravel.

Use following code in your post controller :-


if (Auth::attempt(array('email'=>Input::get('email'), 'password'=>Input::get('password'))))
             {

            return Redirect::to('admin/dashboard')->with('message', 'You are now logged in!');
         }
       
        else {
           
                   return Redirect::to('admin')->with('message', 'Your username/password combination was incorrect');
       
             }

No comments:

Post a Comment