adminarchitect / options by endihunter

Admin Architect - Settings Module. Package provide easy way to load and store options from/in database
1,615
4
3
Package Data
Maintainer Username: endihunter
Maintainer Contact: endi1982@gmail.com (endi)
Package Create Date: 2016-02-22
Package Last Update: 2020-12-27
Language: PHP
License: Unknown
Last Refreshed: 2024-03-25 03:00:36
Package Statistics
Total Downloads: 1,615
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 4
Total Watchers: 3
Total Forks: 3
Total Open Issues: 0

Admin Architect - Options module

adminarchitect/options provides the way to store/read key => value options to/from database.

Installation

Note: this is not standalone package, it can be used only in conjunction with Admin Architect (http://adminarchitect.com) package.

Install adminarchitect/options module by running:

composer require adminarchitect/options

register Options service provider by adding it to the app/config.php providers section:

'providers' => [
	...
	Terranet\Options\ServiceProvider::class
	...
]

Note! Terranet\Options\ServiceProvider::class should be registered BEFORE Terranet\Administrator\ServiceProvider::class.

now you can publish the whole package resources by running:

php artisan vendor:publish [--provider="Terranet\\Options\\ServiceProvider"]

Modules

To create new Settings module, run:

php artisan administrator:resource:settings

Settings module will be created into the app\Http\Terranet\Administrator\Modules directory.

Routes

Routes become available at app\Http\Terranet\Options\routes.php.

Migrations

Create migration for the options table:

php artisan options:table

this will create the migration file inside of database/migrations directory...

Run migration:

php artisan migrate

Optionaly you can create new options for your business:

php artisan options:make <Name> <Value>

Types

Options module supports all know types by Admin Architect: select, boolean, text, textarea, etc... So for example the boolean key may look like:

public function form()
{
    return array_merge(
        $this->scaffoldForm(),
        [
            'ssl' => ['type' => 'boolean', 'label' => 'Use SSL'],
        ]
    );
}

Enjoy!