diff --git a/composer.json b/composer.json index a595901..a508902 100644 --- a/composer.json +++ b/composer.json @@ -1,37 +1,37 @@ { - "name": "hansschouten/laravel-pagebuilder", - "description": "A drag and drop pagebuilder to manage pages in any Laravel project.", - "keywords": [ - "laravel", - "pagebuilder" - ], - "homepage": "https://github.com/HansSchouten/Laravel-Pagebuilder", - "license": "MIT", - "authors": [ - { - "name": "Hans Schouten", - "email": "hans@falcosolutions.nl" - } - ], - "require": { - "php": ">=7.0", - "hansschouten/phpagebuilder": "^0.26" - }, - "autoload": { - "psr-4": { - "HansSchouten\\LaravelPageBuilder\\": "src/" - } - }, - "minimum-stability": "dev", - "prefer-stable": true, - "extra": { - "laravel": { - "providers": [ - "HansSchouten\\LaravelPageBuilder\\ServiceProvider" - ], - "aliases": { - "PageBuilder": "HansSchouten\\LaravelPageBuilder\\Facade" - } - } - } + "name": "hansschouten/laravel-pagebuilder", + "description": "A drag and drop pagebuilder to manage pages in any Laravel project.", + "keywords": [ + "laravel", + "pagebuilder" + ], + "homepage": "https://github.com/HansSchouten/Laravel-Pagebuilder", + "license": "MIT", + "authors": [ + { + "name": "Hans Schouten", + "email": "hans@falcosolutions.nl" + } + ], + "require": { + "php": ">=7.0", + "hansschouten/phpagebuilder": "^0.27" + }, + "autoload": { + "psr-4": { + "HansSchouten\\LaravelPageBuilder\\": "src/" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "extra": { + "laravel": { + "providers": [ + "HansSchouten\\LaravelPageBuilder\\ServiceProvider" + ], + "aliases": { + "PageBuilder": "HansSchouten\\LaravelPageBuilder\\Facade" + } + } + } } diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index d1405ee..b9dc130 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -30,8 +30,11 @@ public function boot() { $this->loadRoutesFrom(__DIR__ . '/../routes/web.php'); $this->loadMigrationsFrom(__DIR__ . '/../migrations'); - - if (Schema::hasTable(config('pagebuilder.storage.database.prefix').'settings')) { + $this->publishes([ + __DIR__ . '/../config/pagebuilder.php' => config_path('pagebuilder.php'), + ], 'config'); + + if (Schema::hasTable(config('pagebuilder.storage.database.prefix') . 'settings')) { if ($this->app->runningInConsole()) { $this->commands([ CreateTheme::class, @@ -43,14 +46,11 @@ public function boot() } // register singleton phpPageBuilder (this ensures phpb_ helpers have the right config without first manually creating a PHPageBuilder instance) - $this->app->singleton('phpPageBuilder', function($app) { + $this->app->singleton('phpPageBuilder', function ($app) { return new PHPageBuilder(config('pagebuilder') ?? []); }); $this->app->make('phpPageBuilder'); - $this->publishes([ - __DIR__ . '/../config/pagebuilder.php' => config_path('pagebuilder.php'), - ], 'config'); $this->publishes([ __DIR__ . '/../themes/demo' => base_path(config('pagebuilder.theme.folder_url') . '/demo'), ], 'demo-theme');