Cleanup
This commit is contained in:
@@ -6,6 +6,21 @@ use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class RepositoryServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Boot the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->bind(
|
||||
|
||||
@@ -3,38 +3,30 @@
|
||||
namespace CachetHQ\Cachet\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use RecursiveDirectoryIterator;
|
||||
|
||||
class RoutingServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Boot the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$files = glob(app_path('routes').'/*.php');
|
||||
|
||||
foreach ($files as $file) {
|
||||
require $file;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
$this->routesInDirectory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Organise Routes.
|
||||
*
|
||||
* @param string $app
|
||||
*/
|
||||
private function routesInDirectory($app = '')
|
||||
{
|
||||
$routeDir = app_path('routes/'.$app.($app !== '' ? '/' : null));
|
||||
|
||||
$iterator = new RecursiveDirectoryIterator($routeDir);
|
||||
$iterator->setFlags(RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
|
||||
foreach ($iterator as $route) {
|
||||
$isDotFile = strpos($route->getFilename(), '.') === 0;
|
||||
|
||||
if (!$isDotFile && !$route->isDir()) {
|
||||
require $routeDir.$route->getFilename();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user