diff --git a/src/Illuminate/Routing/Router.php b/src/Illuminate/Routing/Router.php index 46a7db22e003..479a5b7fd09b 100644 --- a/src/Illuminate/Routing/Router.php +++ b/src/Illuminate/Routing/Router.php @@ -123,10 +123,6 @@ public function __construct(Dispatcher $events, Container $container = null) $this->events = $events; $this->routes = new RouteCollection; $this->container = $container ?: new Container; - - $this->bind('_missing', function ($v) { - return explode('/', $v); - }); } /** @@ -228,39 +224,6 @@ public function match($methods, $uri, $action = null) return $this->addRoute(array_map('strtoupper', (array) $methods), $uri, $action); } - /** - * Set the unmapped global resource parameters to singular. - * - * @param bool $singular - * @return void - */ - public function singularResourceParameters($singular = true) - { - ResourceRegistrar::singularParameters($singular); - } - - /** - * Set the global resource parameter mapping. - * - * @param array $parameters - * @return void - */ - public function resourceParameters(array $parameters = []) - { - ResourceRegistrar::setParameters($parameters); - } - - /** - * Get or set the verbs used in the resource URIs. - * - * @param array $verbs - * @return array|null - */ - public function resourceVerbs(array $verbs = []) - { - return ResourceRegistrar::verbs($verbs); - } - /** * Register an array of resource controllers. * @@ -293,29 +256,6 @@ public function resource($name, $controller, array $options = []) $registrar->register($name, $controller, $options); } - /** - * Register the typical authentication routes for an application. - * - * @return void - */ - public function auth() - { - // Authentication Routes... - $this->get('login', 'Auth\LoginController@showLoginForm')->name('login'); - $this->post('login', 'Auth\LoginController@login'); - $this->post('logout', 'Auth\LoginController@logout')->name('logout'); - - // Registration Routes... - $this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register'); - $this->post('register', 'Auth\RegisterController@register'); - - // Password Reset Routes... - $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm'); - $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail'); - $this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm'); - $this->post('password/reset', 'Auth\ResetPasswordController@reset'); - } - /** * Create a route group with shared attributes. * @@ -1096,6 +1036,16 @@ public function input($key, $default = null) return $this->current()->parameter($key, $default); } + /** + * Get the request currently being dispatched. + * + * @return \Illuminate\Http\Request + */ + public function getCurrentRequest() + { + return $this->currentRequest; + } + /** * Get the currently dispatched route instance. * @@ -1208,13 +1158,59 @@ public function currentRouteUses($action) } /** - * Get the request currently being dispatched. + * Register the typical authentication routes for an application. * - * @return \Illuminate\Http\Request + * @return void */ - public function getCurrentRequest() + public function auth() { - return $this->currentRequest; + // Authentication Routes... + $this->get('login', 'Auth\LoginController@showLoginForm')->name('login'); + $this->post('login', 'Auth\LoginController@login'); + $this->post('logout', 'Auth\LoginController@logout')->name('logout'); + + // Registration Routes... + $this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register'); + $this->post('register', 'Auth\RegisterController@register'); + + // Password Reset Routes... + $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm'); + $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail'); + $this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm'); + $this->post('password/reset', 'Auth\ResetPasswordController@reset'); + } + + /** + * Set the unmapped global resource parameters to singular. + * + * @param bool $singular + * @return void + */ + public function singularResourceParameters($singular = true) + { + ResourceRegistrar::singularParameters($singular); + } + + /** + * Set the global resource parameter mapping. + * + * @param array $parameters + * @return void + */ + public function resourceParameters(array $parameters = []) + { + ResourceRegistrar::setParameters($parameters); + } + + /** + * Get or set the verbs used in the resource URIs. + * + * @param array $verbs + * @return array|null + */ + public function resourceVerbs(array $verbs = []) + { + return ResourceRegistrar::verbs($verbs); } /**