protected function extractViewParameters(Request $request, array $exclude = [])
    {
        $parameters = [];

        foreach ($request->attributes as $key => $value) {
            if (strpos($key, '_') !== 0 && !in_array($key, $exclude)) {
                $parameters[$key] = $value;
            }
        }

        return $parameters;
    }
protected function extractViewParameters(Request $request, array $exclude = [])
    {
        $parameters = [];

        foreach ($request->attributes as $key => $value) {
            if (strpos($key, '_') !== 0 && !in_array($key, $exclude)) {
                $parameters[$key] = $value;
            }
        }

        return $parameters;
    }
protected function extractViewParameters ( Request $ request , array $ exclude = [ ] ) { $ parameters = [ ] ; foreach ( $ request -> attributes as $ key => $ value ) { if ( strpos ( $ key , '_' ) !== 0 && ! in_array ( $ key , $ exclude ) ) { $ parameters [ $ key ] = $ value ; } } return $ parameters ; }
Extract view parameters from Request attributes

@param Request $request
@param array $exclude Keys to exclude from view

@return array
Extract view parameters from Request attributes