src/Middleware/LaratrustMiddleware.php
protected function extractGuard($string)
    {
        $options = Collection::make(explode('|', $string));

        return $options->reject(function ($option) {
            return strpos($option, 'guard:') === false;
        })->map(function ($option) {
            return explode(':', $option)[1];
        })->first();
    }
protected function extractGuard($string)
    {
        $options = Collection::make(explode('|', $string));

        return $options->reject(function ($option) {
            return strpos($option, 'guard:') === false;
        })->map(function ($option) {
            return explode(':', $option)[1];
        })->first();
    }
protected function extractGuard ( $ string ) { $ options = Collection :: make ( explode ( '|' , $ string ) ) ; return $ options -> reject ( function ( $ option ) { return strpos ( $ option , 'guard:' ) === false ; } ) -> map ( function ( $ option ) { return explode ( ':' , $ option ) [ 1 ] ; } ) -> first ( ) ; }
Extract the guard type from the given string.

@param  string $string
@return string
Extract the guard type from the given string .