diff --git a/laravel/auth.php b/laravel/auth.php index 2a390322..f692e52b 100644 --- a/laravel/auth.php +++ b/laravel/auth.php @@ -62,7 +62,7 @@ public static function user() { if ( ! is_null(static::$user)) return static::$user; - $id = Session::get(Auth::user_key); + $id = IoC::core('session')->get(Auth::user_key); // To retrieve the user, we'll first attempt to use the "user" Closure // defined in the auth configuration file, passing in the ID. The user diff --git a/laravel/routing/route.php b/laravel/routing/route.php index 19267431..ddabf660 100644 --- a/laravel/routing/route.php +++ b/laravel/routing/route.php @@ -79,7 +79,7 @@ public function __construct($key, $action, $parameters = array()) */ protected static function extract($segment) { - $uri = substr($segment, strpos($segment, ' ')); + $uri = substr($segment, strpos($segment, ' ') + 1); return ($uri !== '/') ? trim($uri, '/') : $uri; } diff --git a/laravel/routing/router.php b/laravel/routing/router.php index 1dcb595d..48cf41f1 100644 --- a/laravel/routing/router.php +++ b/laravel/routing/router.php @@ -200,6 +200,8 @@ 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); } @@ -243,6 +245,8 @@ 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 639e7aed..246724d2 100644 --- a/tests/cases/laravel/route.test.php +++ b/tests/cases/laravel/route.test.php @@ -17,13 +17,13 @@ public function tearDown() */ public function testHandlesIndicatesIfTheRouteHandlesAGivenURI() { - $route = new Laravel\Routing\Route('GET /', array('handles' => array('foo/bar'))); + $route = new Laravel\Routing\Route('GET /', array('handles' => array('GET /foo/bar'))); $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('/', 'home'))); + $route = new Laravel\Routing\Route('GET /', array('handles' => array('GET /', 'GET /home'))); $this->assertTrue($route->handles('/')); $this->assertTrue($route->handles('home'));