Skip to content

Instantly share code, notes, and snippets.

@Mulkave
Last active June 8, 2016 21:12
Show Gist options
  • Save Mulkave/c1b2a181d56a03b9e0aefa20d2a81a9b to your computer and use it in GitHub Desktop.
Save Mulkave/c1b2a181d56a03b9e0aefa20d2a81a9b to your computer and use it in GitHub Desktop.
<?php
namespace Directory\Foundation\Providers;
use Illuminate\Routing\Router;
use Caffeinated\Modules\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
protected $serviceName = '';
public function map(Router $router)
{
$namespace = config('modules.namespace').$this->serviceName.'\Http\Controllers';
$router->group(['namespace' => $namespace], function($router)
{
$routesFile = config('modules.path').'/'.$this->serviceName.'/Http/routes.php';
if (file_exists($routesFile)) {
require $routesFile;
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment