Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Http\Controllers\Auth;
  4.  
  5. use App\Http\Controllers\Controller;
  6. use Illuminate\Foundation\Auth\AuthenticatesUsers;
  7.  
  8. class LoginController extends Controller
  9. {
  10.     /*
  11.     |--------------------------------------------------------------------------
  12.     | Login Controller
  13.     |--------------------------------------------------------------------------
  14.     |
  15.     | This controller handles authenticating users for the application and
  16.     | redirecting them to your home screen. The controller uses a trait
  17.     | to conveniently provide its functionality to your applications.
  18.     |
  19.     */
  20.  
  21.     use AuthenticatesUsers;
  22.  
  23.     /**
  24.      * Create a new controller instance.
  25.      *
  26.      * @return void
  27.      */
  28.     public function __construct()
  29.     {
  30.         $this->middleware('guest', ['except' => 'logout']);
  31.     }
  32.  
  33.     /**
  34.      * Use username field for authentication
  35.      *
  36.      * @return void
  37.      */
  38.     public function username()
  39.     {
  40.         return 'username';
  41.     }
  42.  
  43.     protected function redirectTo()
  44.     {
  45.         // Custom logic
  46.         return '/admin';
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement