diff --git a/src/Illuminate/Routing/Route.php b/src/Illuminate/Routing/Route.php index 2f47d0d54b0f..fe88d0d6f2f8 100755 --- a/src/Illuminate/Routing/Route.php +++ b/src/Illuminate/Routing/Route.php @@ -93,13 +93,6 @@ class Route */ protected $originalParameters; - /** - * The parameters to exlude when determining the route's parameter names. - * - * @var array - */ - public $excludedParameters = []; - /** * Indicates "trashed" models can be retrieved when resolving implicit model bindings for this route. * @@ -514,11 +507,9 @@ protected function compileParameterNames() { preg_match_all('/\{(.*?)\}/', $this->getDomain().$this->uri, $matches); - return array_values(array_filter(array_map(function ($m) { + return array_map(function ($m) { return trim($m, '?'); - }, $matches[1]), function ($parameterName) { - return ! array_key_exists($parameterName, $this->excludedParameters); - })); + }, $matches[1]); } /** diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php index 2220f82c6f8f..81e475bba0ee 100755 --- a/src/Illuminate/Routing/UrlGenerator.php +++ b/src/Illuminate/Routing/UrlGenerator.php @@ -478,8 +478,6 @@ public function route($name, $parameters = [], $absolute = true) */ public function toRoute($route, $parameters, $absolute) { - $route->excludedParameters = $this->getDefaultParameters(); - $parameters = collect(Arr::wrap($parameters))->map(function ($value, $key) use ($route) { return $value instanceof UrlRoutable && $route->bindingFieldFor($key) ? $value->{$route->bindingFieldFor($key)} diff --git a/tests/Routing/RoutingUrlGeneratorTest.php b/tests/Routing/RoutingUrlGeneratorTest.php index 217e2466ae46..9631519477e4 100755 --- a/tests/Routing/RoutingUrlGeneratorTest.php +++ b/tests/Routing/RoutingUrlGeneratorTest.php @@ -369,28 +369,8 @@ public function testRoutableInterfaceRoutingWithCustomBindingField() $model = new RoutableInterfaceStub; $model->key = 'routable'; - $this->assertSame('/foo/test-slug', $url->route('routable', $model, false)); - $this->assertSame('/foo/test-slug', $url->route('routable', [$model], false)); $this->assertSame('/foo/test-slug', $url->route('routable', ['bar' => $model], false)); - } - - public function testRoutableInterfaceRoutingWithUrlDefaults() - { - $url = new UrlGenerator( - $routes = new RouteCollection, - Request::create('http://www.foo.com/') - ); - - $url->defaults(['locale' => 'baz']); - $route = new Route(['GET'], '{locale}/foo/{bar:slug}', ['as' => 'routable']); - $routes->add($route); - - $model = new RoutableInterfaceStub; - $model->key = 'routable'; - - $this->assertSame('/baz/foo/test-slug', $url->route('routable', $model, false)); - $this->assertSame('/baz/foo/test-slug', $url->route('routable', [$model], false)); - $this->assertSame('/baz/foo/test-slug', $url->route('routable', ['bar' => $model], false)); + $this->assertSame('/foo/test-slug', $url->route('routable', [$model], false)); } public function testRoutableInterfaceRoutingAsQueryString()