Skip to content

Commit

Permalink
Use file-based configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
devemlight committed Apr 4, 2018
1 parent 3204e24 commit a144816
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
2 changes: 0 additions & 2 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public function pluginDetails()

public function boot()
{
$this->app->register(ServiceProvider::class);

$this->registerPageEvents();
}

Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 0 additions & 10 deletions ServiceProvider.php

This file was deleted.

2 changes: 1 addition & 1 deletion classes/PageSettingsFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions updates/version.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
1.0.1:
- First version
- create_page_settings_table.php
- First version.
- create_page_settings_table.php
1.1.0: Use file-based configuration inside the plugin without publishing.

0 comments on commit a144816

Please sign in to comment.