protected function getNestedParameters($name, array $parameters)
    {
        $reserved = ['create', 'show', 'index', 'delete', 'destroy', 'edit'];
        $nested   = [];

        if (($nestedCount = count($parameters)) > 0) {
            $nested = [$name => $parameters[0]];

            for ($index = 1; $index < $nestedCount; $index += 2) {
                $value = null;

                if (($index + 1) < $nestedCount) {
                    $value = $parameters[($index + 1)];
                }

                $key = $parameters[$index];

                ! in_array($key, $reserved) && $nested[$key] = $value;
            }
        }

        return $nested;
    }
protected function getNestedParameters($name, array $parameters)
    {
        $reserved = ['create', 'show', 'index', 'delete', 'destroy', 'edit'];
        $nested   = [];

        if (($nestedCount = count($parameters)) > 0) {
            $nested = [$name => $parameters[0]];

            for ($index = 1; $index < $nestedCount; $index += 2) {
                $value = null;

                if (($index + 1) < $nestedCount) {
                    $value = $parameters[($index + 1)];
                }

                $key = $parameters[$index];

                ! in_array($key, $reserved) && $nested[$key] = $value;
            }
        }

        return $nested;
    }
protected function getNestedParameters ( $ name , array $ parameters ) { $ reserved = [ 'create' , 'show' , 'index' , 'delete' , 'destroy' , 'edit' ] ; $ nested = [ ] ; if ( ( $ nestedCount = count ( $ parameters ) ) > 0 ) { $ nested = [ $ name => $ parameters [ 0 ] ] ; for ( $ index = 1 ; $ index < $ nestedCount ; $ index += 2 ) { $ value = null ; if ( ( $ index + 1 ) < $ nestedCount ) { $ value = $ parameters [ ( $ index + 1 ) ] ; } $ key = $ parameters [ $ index ] ; ! in_array ( $ key , $ reserved ) && $ nested [ $ key ] = $ value ; } } return $ nested ; }
Find nested parameters from route.

@param  string  $name
@param  array  $parameters

@return array
Find nested parameters from route .