Cleanup
This commit is contained in:
@@ -71,7 +71,5 @@ App::down(function () {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require app_path().'/filters.php';
|
require app_path().'/filters.php';
|
||||||
|
|
||||||
require app_path().'/view-composers.php';
|
require app_path().'/view-composers.php';
|
||||||
|
|
||||||
require app_path().'/helpers.php';
|
require app_path().'/helpers.php';
|
||||||
|
|||||||
@@ -6,6 +6,21 @@ use Illuminate\Support\ServiceProvider;
|
|||||||
|
|
||||||
class RepositoryServiceProvider extends ServiceProvider
|
class RepositoryServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Boot the service provider.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the service provider.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
|||||||
@@ -3,38 +3,30 @@
|
|||||||
namespace CachetHQ\Cachet\Providers;
|
namespace CachetHQ\Cachet\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use RecursiveDirectoryIterator;
|
|
||||||
|
|
||||||
class RoutingServiceProvider extends ServiceProvider
|
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 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