Skip to content

Instantly share code, notes, and snippets.

@jinoantony
Created June 18, 2018 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jinoantony/48477327219d05d8b21e4054fa127ebb to your computer and use it in GitHub Desktop.
Save jinoantony/48477327219d05d8b21e4054fa127ebb to your computer and use it in GitHub Desktop.
AdminLoginController
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class AdminLoginController 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;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = 'admin/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest:admin,admin/home')->except('logout');
}
public function redirectTo()
{
return 'admin/home';
}
protected function guard()
{
return \Auth::guard('admin');
}
public function showLoginForm()
{
return view('auth.adminlogin');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment