-

Learn the terrain.

+

Learn the terrain.

You've landed yourself on our default home page. The route that From dc81e1b7ab4d2771eff9772d09e9c45c4c138aed Mon Sep 17 00:00:00 2001 From: Rob Meijer Date: Sat, 2 Jun 2012 22:13:09 +0100 Subject: [PATCH 5/8] Add a note about registering a named route that points to a controller action. --- laravel/documentation/routing.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/laravel/documentation/routing.md b/laravel/documentation/routing.md index fc607cb9..18c90671 100644 --- a/laravel/documentation/routing.md +++ b/laravel/documentation/routing.md @@ -307,6 +307,10 @@ This routing convention may not be desirable for every situation, so you may als Route::get('welcome', array('after' => 'log', 'uses' => 'home@index')); +#### Registering a named route that points to a controller action: + + Route::get('welcome', array('as' => 'home.welcome', 'uses' => 'home@index')); + ## CLI Route Testing From ab2fcb84ef1af5e72e9da8b18d6193053a295dd0 Mon Sep 17 00:00:00 2001 From: Jason Lewis Date: Sun, 3 Jun 2012 19:23:35 +0930 Subject: [PATCH 6/8] Possible fix for issue #378. Signed-off-by: Jason Lewis --- laravel/database/eloquent/model.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 91aedd6e..a6a32780 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -230,11 +230,9 @@ abstract class Model { * @param array $columns * @return Model */ - public static function find($id, $columns = array('*')) + public function _find($id, $columns = array('*')) { - $model = new static; - - return $model->query()->where(static::$key, '=', $id)->first($columns); + return $this->query()->where(static::$key, '=', $id)->first($columns); } /** @@ -749,7 +747,7 @@ abstract class Model { // Some methods need to be accessed both staticly and non-staticly so we'll // keep underscored methods of those methods and intercept calls to them // here so they can be called either way on the model instance. - if (in_array($method, array('with'))) + if (in_array($method, array('with', 'find'))) { return call_user_func_array(array($this, '_'.$method), $parameters); } From b4db0f1b36b6d6c9c5346a51ec7d5a4090f85bb9 Mon Sep 17 00:00:00 2001 From: Jason Lewis Date: Sun, 3 Jun 2012 19:45:49 +0930 Subject: [PATCH 7/8] Small change moving array to a variable. Signed-off-by: Jason Lewis --- laravel/database/eloquent/model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index a6a32780..95e14ab5 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -744,10 +744,12 @@ abstract class Model { return static::$$method; } + $underscored = array('with', 'find') + // Some methods need to be accessed both staticly and non-staticly so we'll // keep underscored methods of those methods and intercept calls to them // here so they can be called either way on the model instance. - if (in_array($method, array('with', 'find'))) + if (in_array($method, $underscored)) { return call_user_func_array(array($this, '_'.$method), $parameters); } From 6d5239bf3099842535f110518e89e51d1e766f3e Mon Sep 17 00:00:00 2001 From: Jason Lewis Date: Sun, 3 Jun 2012 19:47:44 +0930 Subject: [PATCH 8/8] Missed a semi-colon. Signed-off-by: Jason Lewis --- laravel/database/eloquent/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 95e14ab5..2c28b8f9 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -744,7 +744,7 @@ abstract class Model { return static::$$method; } - $underscored = array('with', 'find') + $underscored = array('with', 'find'); // Some methods need to be accessed both staticly and non-staticly so we'll // keep underscored methods of those methods and intercept calls to them