Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Http\Controllers\Auth;
- use App\Http\Controllers\Controller;
- use Illuminate\Foundation\Auth\AuthenticatesUsers;
- class LoginController extends Controller
- {
- /*
- |--------------------------------------------------------------------------
- | Login Controller
- |--------------------------------------------------------------------------
- |
- | This controller handles authenticating users for the application and
- | redirecting them to your home screen. The controller uses a trait
- | to conveniently provide its functionality to your applications.
- |
- */
- use AuthenticatesUsers;
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
- {
- $this->middleware('guest', ['except' => 'logout']);
- }
- /**
- * Use username field for authentication
- *
- * @return void
- */
- public function username()
- {
- return 'username';
- }
- protected function redirectTo()
- {
- // Custom logic
- return '/admin';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement