public static function getAuthGuards(Request $request)
    {
        $middlewares = $request->route()->middleware();

        $guards = [];
        foreach ($middlewares as $middleware) {
            if (Str::startsWith($middleware, 'auth')) {
                $explodedGuards = explode(',', Str::after($middleware, ':'));
                $guards = array_unique(array_merge($guards, $explodedGuards));
            }
        }

        return $guards;
    }
public static function getAuthGuards(Request $request)
    {
        $middlewares = $request->route()->middleware();

        $guards = [];
        foreach ($middlewares as $middleware) {
            if (Str::startsWith($middleware, 'auth')) {
                $explodedGuards = explode(',', Str::after($middleware, ':'));
                $guards = array_unique(array_merge($guards, $explodedGuards));
            }
        }

        return $guards;
    }
public static function getAuthGuards ( Request $ request ) { $ middlewares = $ request -> route ( ) -> middleware ( ) ; $ guards = [ ] ; foreach ( $ middlewares as $ middleware ) { if ( Str :: startsWith ( $ middleware , 'auth' ) ) { $ explodedGuards = explode ( ',' , Str :: after ( $ middleware , ':' ) ) ; $ guards = array_unique ( array_merge ( $ guards , $ explodedGuards ) ) ; } } return $ guards ; }
Get guards passed as parameters to `auth` middleware.

@param  \Illuminate\Http\Request $request
@return array
Get guards passed as parameters to auth middleware .