Skip to content

Commit 3e6e94d

Browse files
authoredSep 19, 2020
Update module-admin-configuration.md
1 parent 9914993 commit 3e6e94d

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed
 

‎module-admin-configuration.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
# Module Admin Configuration
22

3-
`AdminConfiguration` facade is very helpful for adding an configuration for your custom module. Let say you want add a configuration for your shipping module of AvoRed E commerce. You can do that simply adding into your `module.php` files `boot` method by registering an AdminConfiguration.
3+
Admin configuration is a way to storing the system level values into a database and as a module developer can use those values into different stages of an module.
44

5-
```php
6-
use AvoRed\Framework\AdminConfiguration\Facade as AdminConfigurationFacade;
5+
Admin Configuration is now part of an `\AvoRed\Framework\Support\Facades\Tab` facade. Only the thing that have to keep in mind that when you register a tab for a Admin Configuration make the key stay intact with the existing `avored/framework`.
6+
7+
Let me give you an example: Let say you want to add a configuration for a AvoRed Pickup shipping module and you want to add configuration regarding that. In this situation you can simple open your `Module.php@boot` method and add the below code to register an tab.
78

89

9-
// How to add a new Configuration Tab/Accordion
10-
$configurationGroup = AdminConfigurationFacade::add('my_custom_accordion')->label('My Custom Accordion');
10+
```php
11+
use AvoRed\Framework\Support\Facades\Tab;
12+
use AvoRed\Framework\Tab\TabItem;
1113

12-
// How to add a new Configuration Tab/Accordion
13-
$paymentGroup = AdminConfigurationFacade::get('payment');
1414

15-
$paymentGroup->addConfiguration('shipping_free_shipping_enabled')
16-
->label('Is Free Shipping Enabled')
17-
->type('select')
18-
->name('shipping_free_shipping_enabled')
19-
->options(function (){
20-
$options = [1 => 'Yes' , 0 => 'No'];
21-
return $options;
15+
// How to add a new Admin Configuration Tab
16+
@note Check the Tab Key here. Make sure do not change the ***system.confuguration*** as a key.
17+
Tab::put('system.configuration', function (TabItem $tab) {
18+
$tab->key('system.configuration.pickup')
19+
->label('avored-pickup::system.config-title')
20+
->view('avored-pickup::system.configuration.pickup');
2221
});
2322
```
2423

0 commit comments

Comments
 (0)
Please sign in to comment.