diff --git a/laravel/routing/route.php b/laravel/routing/route.php index ddabf660..ee1893d7 100644 --- a/laravel/routing/route.php +++ b/laravel/routing/route.php @@ -58,7 +58,7 @@ public function __construct($key, $action, $parameters = array()) // Extract each URI from the route key. Since the route key has the request // method, we will extract that from the string. If the URI points to the // root of the application, a single forward slash will be returned. - $uris = array_get($action, 'handles', array()); + $uris = array_get($action, 'handles', array($key)); $this->uris = array_map(array($this, 'extract'), $uris); diff --git a/laravel/routing/router.php b/laravel/routing/router.php index 48cf41f1..1dcb595d 100644 --- a/laravel/routing/router.php +++ b/laravel/routing/router.php @@ -200,8 +200,6 @@ protected static function controller($bundle, $method, $destination, $segments) $action = array('uses' => Bundle::prefix($bundle).'home@index'); - $action['handles'] = array($destination); - return new Route($method.' '.$uri, $action); } @@ -245,8 +243,6 @@ protected static function controller($bundle, $method, $destination, $segments) $action = array('uses' => $prefix.$controller.'@'.$method); - $action['handles'] = array($destination); - return new Route($destination, $action, $segments); } } diff --git a/tests/cases/laravel/route.test.php b/tests/cases/laravel/route.test.php index 246724d2..5be4f2ec 100644 --- a/tests/cases/laravel/route.test.php +++ b/tests/cases/laravel/route.test.php @@ -19,9 +19,10 @@ public function testHandlesIndicatesIfTheRouteHandlesAGivenURI() { $route = new Laravel\Routing\Route('GET /', array('handles' => array('GET /foo/bar'))); + $this->assertFalse($route->handles('/')); + $this->assertFalse($route->handles('baz')); $this->assertTrue($route->handles('foo/*')); $this->assertTrue($route->handles('foo/bar')); - $this->assertFalse($route->handles('baz')); $route = new Laravel\Routing\Route('GET /', array('handles' => array('GET /', 'GET /home')));