Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move route group logic to core RouteServiceProvider #3

Merged
merged 1 commit into from
Feb 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Http/backendRoutes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

$router->get('/', ['as' => 'dashboard.index', 'uses' => 'DashboardController@index']);
9 changes: 0 additions & 9 deletions Http/routes.php

This file was deleted.

37 changes: 10 additions & 27 deletions Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,46 +1,29 @@
<?php namespace Modules\Dashboard\Providers;

use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Modules\Core\Providers\RoutingServiceProvider as CoreRoutingServiceProvider;

class RouteServiceProvider extends CoreRoutingServiceProvider {

class RouteServiceProvider extends ServiceProvider
{
/**
* The root namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $rootUrlNamespace = 'Modules\Dashboard\Http\Controllers';

/**
* The controllers to scan for route annotations.
*
* @var array
*/
protected $scan = [
'Modules\Dashboard\Http\Controllers',
];
protected $namespace = 'Modules\Dashboard\Http\Controllers';

/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @param Router $router
* @return void
* @return string
*/
public function before(Router $router)
protected function getFrontendRoute()
{
//
return false;
}

/**
* Define the routes for the application.
*
* @return void
* @return string
*/
public function map(Router $router)
protected function getBackendRoute()
{
require __DIR__.'/../Http/routes.php';
return __DIR__ . '/../Http/backendRoutes.php';
}
}