diff --git a/Plugin.php b/Plugin.php index 1dca0c8..58d568a 100644 --- a/Plugin.php +++ b/Plugin.php @@ -18,8 +18,6 @@ public function pluginDetails() public function boot() { - $this->app->register(ServiceProvider::class); - $this->registerPageEvents(); } diff --git a/README.md b/README.md index 0184564..d0c2bcd 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,17 @@ After the page is saved the fields will be stored to the database and removed fr ## Configuration -You can specify fields to be stored in the database in the `config/page.php` file. -To publish the configuration file run the following command: +File-based configuration http://octobercms.com/docs/plugin/settings#file-configuration +This plugin has a configuration file `config.php` in the `config` subdirectory of the plugin directory. +A plugin configuration can be overridden by the application by creating a configuration file: ``` -php artisan vendor:publish --provider="Isswp101\PageSettings\ServiceProvider" +mkdir -p config/isswp101/pagesettings +cp plugins/isswp101/pagesettings/config/config.php config/isswp101/pagesettings ``` +The configuration file will be located here `config/isswp101/pagesettings/config.php` + If you extend the page using https://octobercms.com/docs/plugin/extending#extending-backend-form you can specify your fields in the configuration as well. diff --git a/ServiceProvider.php b/ServiceProvider.php deleted file mode 100644 index f0b46eb..0000000 --- a/ServiceProvider.php +++ /dev/null @@ -1,10 +0,0 @@ -publishes([$configPath => config_path('page.php')], 'config'); - } -} \ No newline at end of file diff --git a/classes/PageSettingsFacade.php b/classes/PageSettingsFacade.php index fb413d9..45bdae0 100644 --- a/classes/PageSettingsFacade.php +++ b/classes/PageSettingsFacade.php @@ -56,7 +56,7 @@ protected function getPageAttributes() 'meta_title', 'meta_description', ]; - return config('page.attributes', $default); + return config('isswp101.pagesettings::attributes', $default); } protected function findPageSettingsToPut($key) diff --git a/config/page.php b/config/config.php similarity index 100% rename from config/page.php rename to config/config.php diff --git a/updates/version.yaml b/updates/version.yaml index 4b90d67..7060c4f 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -1,3 +1,4 @@ 1.0.1: - - First version - - create_page_settings_table.php \ No newline at end of file + - First version. + - create_page_settings_table.php +1.1.0: Use file-based configuration inside the plugin without publishing. \ No newline at end of file