Admin Architect - Settings Module. Package provide easy way to load and store options from/in database
adminarchitect/options provides the way to store/read key => value options to/from database., (*1)
Note:
this is not standalone package, it can be used only in conjunction with Admin Architect
(http://adminarchitect.com
) package., (*2)
Install adminarchitect/options module by running:, (*3)
composer require adminarchitect/options
register Options service provider by adding it to the app/config.php providers
section:, (*4)
'providers' => [ ... Terranet\Options\ServiceProvider::class ... ]
Note! Terranet\Options\ServiceProvider::class
should be registered BEFORE Terranet\Administrator\ServiceProvider::class
., (*5)
now you can publish the whole package resources by running:, (*6)
php artisan vendor:publish [--provider="Terranet\\Options\\ServiceProvider"]
To create new Settings module, run:, (*7)
php artisan administrator:resource:settings
Settings
module will be created into the app\Http\Terranet\Administrator\Modules
directory., (*8)
Routes become available at app\Http\Terranet\Options\routes.php
., (*9)
Create migration for the options table:, (*10)
php artisan options:table
this will create the migration file inside of database/migrations
directory..., (*11)
Run migration:, (*12)
php artisan migrate
Optionaly you can create new options for your business:, (*13)
php artisan options:make <Name> <Value>
Options module supports all know types by Admin Architect: select, boolean, text, textarea, etc... So for example the boolean key may look like:, (*14)
public function form() { return array_merge( $this->scaffoldForm(), [ 'ssl' => ['type' => 'boolean', 'label' => 'Use SSL'], ] ); }
Enjoy!, (*15)