public function routeIs(...$patterns)
    {
        if (! Arr::exists($route = $this->route()[1], 'as')) {
            return false;
        }

        foreach ($patterns as $pattern) {
            if (Str::is($pattern, $route['as'])) {
                return true;
            }
        }

        return false;
    }
public function routeIs(...$patterns)
    {
        if (! Arr::exists($route = $this->route()[1], 'as')) {
            return false;
        }

        foreach ($patterns as $pattern) {
            if (Str::is($pattern, $route['as'])) {
                return true;
            }
        }

        return false;
    }
public function routeIs ( ... $ patterns ) { if ( ! Arr :: exists ( $ route = $ this -> route ( ) [ 1 ] , 'as' ) ) { return false ; } foreach ( $ patterns as $ pattern ) { if ( Str :: is ( $ pattern , $ route [ 'as' ] ) ) { return true ; } } return false ; }
Determine if the route name matches a given pattern.

@param  mixed  $patterns
@return bool
Determine if the route name matches a given pattern .