Hello World
This is the default setting page of the {{ '{{' }} $plugin->name {{ '}}' }} plugin!
The page is rendered by \{{ author_class }}\{{ name_class }}\Controllers\DashboardController@index
, feel free to replace it with actual content.
Translation
Below is a phrase retrieved from I18n.
If it does not work, you can issue the php artisan translation:upgrade
command then refresh this page
{{ '{{' }} trans('{{ name }}::messages.intro') {{ '}}' }}
IMPORTANT. The translation file is available at storage/app/plugins/{{ author }}/{{ name }}/resources/lang/en/messages.php
.
However, remember to execute the artisan
command above every time you update the file.
Otherwise new translation phrases will not load.
Get started
You can now now modify this plugin template to add functionality.
- Add new routes in
./routes.php
- Add more actions to this controller file at
./src/Controllers/DashboardController.php
- Add new pages to the
./resources/views/
folder. - Check out the service provider for this plugin at
./src/ServiceProvider.php
folder. - Add any PHP file and class you desire to
./src
folder which follows the PRS-4 convention.
For example, add aSample
class in a./src/Sample.php
file and access it using the its full namespace of\{{ author_class }}\{{ name_class }}\Sample
Storage
Sometimes a plugin may require users' input or settings. Then you can use the data
field of the plugins
DB table to store the information.
$plugin = \Acelle\Model\Plugin::where('name', '{{ plugin }}')->first();
$plugin->data = json_encode( [ 'plugin data' ] );
$plugin->save();