Skip to content

Instantly share code, notes, and snippets.

@ziyahan
Created March 11, 2015 07:17
Show Gist options
  • Save ziyahan/f5214dec25feb353fcf4 to your computer and use it in GitHub Desktop.
Save ziyahan/f5214dec25feb353fcf4 to your computer and use it in GitHub Desktop.
ServiceProvider.php
<?php namespace App\Modules;
class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
public function boot()
{
$modules = config("module.modules");
while (list(,$module) = each($modules)) {
if(file_exists(__DIR__.'/'.$module.'/routes.php')) {
include __DIR__.'/'.$module.'/routes.php';
}
if(is_dir(__DIR__.'/'.$module.'/Views')) {
$this->loadViewsFrom(__DIR__.'/'.$module.'/Views', $module);
}
}
}
public function register(){}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment