From d3bf13b10bc24a6393620e6aecc08dab2e340c8d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 14 Oct 2014 20:07:12 -0500 Subject: [PATCH] Working on routing and providers. --- app/Http/Controllers/HomeController.php | 12 ++++---- app/Http/routes.php | 14 ---------- app/Providers/EventServiceProvider.php | 9 ++++++ app/Providers/RouteServiceProvider.php | 37 +++++++++++++++---------- 4 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 app/Http/routes.php diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 9538ba0e..eaf59114 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -4,19 +4,17 @@ class HomeController { /* |-------------------------------------------------------------------------- - | Default Home Controller + | Home Controller |-------------------------------------------------------------------------- | - | You may wish to use controllers instead of, or in addition to, Closure - | based routes. That's great! Here is an example controller method to - | get you started. To route to this controller, just add the route: - | - | $router->get('/', 'HomeController@index'); + | Controller methods are called when a request enters the application + | with their assigned URI. The URI a method responds to may be set + | via simple annotations. Here is an example to get you started! | */ /** - * @Get("/", as="home") + * @Get("/") */ public function index() { diff --git a/app/Http/routes.php b/app/Http/routes.php deleted file mode 100644 index 6d822b05..00000000 --- a/app/Http/routes.php +++ /dev/null @@ -1,14 +0,0 @@ -get('/', 'HomeController@index'); diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 52a76d0f..f857796f 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -15,4 +15,13 @@ class EventServiceProvider extends ServiceProvider { ], ]; + /** + * The classes to scan for event annotations. + * + * @var array + */ + protected $scan = [ + // + ]; + } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index a4be7f02..2889321a 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -1,23 +1,39 @@ setRootControllerNamespace('App\Http\Controllers'); + // } /** @@ -25,18 +41,9 @@ public function before(Router $router, UrlGenerator $url) * * @return void */ - public function map() + public function map(Router $router) { - // Once the application has booted, we will include the default routes - // file. This "namespace" helper will load the routes file within a - // route group which automatically sets the controller namespace. - $this->app->booted(function() - { - $this->namespaced('App\Http\Controllers', function(Router $router) - { - require app_path().'/Http/routes.php'; - }); - }); + // } }