Skip to content

Commit

Permalink
gotta register in app booted, not statamic booted
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell committed Dec 22, 2020
1 parent 8d2afe4 commit 7cccfe6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ First, create a `config.yaml` file in `resources\config` that contains the bluep

Then, in the `boot` method of your addon's Service Provider add:
```php
\Edalzell\Forma\Forma::add('package/name');
$this->app->booted(function () {
\Edalzell\Forma\Forma::add('silentz/mailchimp', ConfigController::class);
});
```

The second parameter is optional and only needed if you need custom config handling (see Exending below)

Once you do that, you get a menu item in the cp that your users can access and use. All data is saved into your `addon_handle.php` in the `config` folder.

![menu item](https://raw.githubusercontent.com/edalzell/statamic-forma/main/images/mailchimp-menu.png)
Expand Down

0 comments on commit 7cccfe6

Please sign in to comment.