So here’s the thing.
I have created and packaged my own plugin, one that interfaces with an SMS API.
In order to do that, I require an API key during setup.
The way my configuration works right now, is I have a file at my plugin’s config/bootstrap.php
where I do this.
Configure::write('SMSMessenger.api_key', 'MY_KEY');
However, this is not practical for the user to change since he has to find the file in /vendor/namespace/plugin/config/bootstrap.php
How would you go about configuration like this?
I see that other plugins require the user to manually add configuration inside app.php, for example in the ‘Datasources’ array.
Isn’t there a more streamlined way to do this?
The optimal outcome would be:
- I install the plugin via composer
- I open my app.php (or bootstrap.php or any other file in MY application)
- I find the required section where code is already injected for me, and I just change the MY_KEY value.
Secondary thought: Could there be an even easier way to streamline this using .env? I don’t have much experience with it and there’s nothing in the docs on the plugins section about .env integration
Thanks in advance guys!