REFACTORING: move part of content business logic into repository
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\CMS\Handlers\Registrators\MenuExtensionRegistrator;
|
||||
use App\CMS\Contracts\Repositories\Content as IContent;
|
||||
use App\CMS\Contracts\Repositories\Module as IModule;
|
||||
use App\CMS\Handlers\Registrators\SearchEngineRegistrator;
|
||||
use App\CMS\Handlers\Registrators\SettingsExtensionRegistrator;
|
||||
use App\CMS\Handlers\Registrators\TemplateRegistrator;
|
||||
@@ -11,10 +12,15 @@ use App\CMS\Handlers\Search\Content;
|
||||
use App\CMS\Handlers\Search\Files;
|
||||
use App\CMS\Handlers\Search\Presenters\AdminContent as AdminContentPresenter;
|
||||
use App\CMS\Handlers\Search\Presenters\AdminFiles;
|
||||
use App\CMS\Repositories\Content\Content as ContentRepository;
|
||||
use App\CMS\Repositories\Module as ModuleRepository;
|
||||
use App\CMS\Widgets\HtmlCode\HtmlCode;
|
||||
use App\CMS\Widgets\Menu\Menu;
|
||||
use Barryvdh\Debugbar\ServiceProvider as DebugBarServiceProvider;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Pingpong\Menus\MenusServiceProvider;
|
||||
use Pingpong\Modules\ModulesServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -32,6 +38,9 @@ class AppServiceProvider extends ServiceProvider
|
||||
$this->registerWidgets();
|
||||
$this->registerSettings();
|
||||
$this->registerSearch();
|
||||
|
||||
$this->app->bind(IContent::class, ContentRepository::class);
|
||||
$this->app->bind(IModule::class, ModuleRepository::class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,19 +49,13 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
if ($this->app->environment() == 'local') {
|
||||
try {
|
||||
$this->app->register('Barryvdh\Debugbar\ServiceProvider');
|
||||
} catch (\Exception $e) {
|
||||
// this service provider may not exist when switching from other environment than local
|
||||
// until composer install is run
|
||||
// just ignore this exception and when no service provider is available, do not use debugbar
|
||||
}
|
||||
if ($this->app->environment() == 'local' && class_exists(DebugBarServiceProvider::class)) {
|
||||
$this->app->register(DebugBarServiceProvider::class);
|
||||
}
|
||||
|
||||
// register PingPong module extension
|
||||
$this->app->register('Pingpong\Modules\ModulesServiceProvider');
|
||||
$this->app->register('Pingpong\Menus\MenusServiceProvider');
|
||||
$this->app->register(ModulesServiceProvider::class);
|
||||
$this->app->register(MenusServiceProvider::class);
|
||||
$this->app->register(LaravelLocalizationServiceProvider::class);
|
||||
|
||||
// create singletons for registering widgets
|
||||
|
||||
Reference in New Issue
Block a user