Skip to main content

Posts

Showing posts from July, 2018

Multiple Login Creation and pw reset

Reference site : https://medium.com/hello-laravel/multiple-authentication-system-laravel-5-4-ac94c759638a CIAA Project reference Admin login controller: public function __construct() { $this ->middleware( 'guest:admin' )->except( 'logout' ); } Logout of normal user function logout(Request $request ){ { // dd('test'); $this ->guard( 'admin' )->logout(); $activeGuards = 0 ; foreach (config( 'auth.guards' ) as $guard => $guardConfig ) { if ( $guardConfig [ 'driver' ] === 'session' ) { $guardName = Auth:: guard ( $guard )->getName(); if ( $request ->session()->has( $guardName ) && $request ->session()->get( $guardName ) === Auth:: guard ( $guard )->user()->getAuthIdentifier()) { $activeGuards ++; } }