Download the PHP package rezahmady/setting-operation without Composer
On this page you can find all versions of the php package rezahmady/setting-operation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rezahmady/setting-operation
More information about rezahmady/setting-operation
Files in rezahmady/setting-operation
Package setting-operation
Short Description setting operation for backpackforlaravel package
License MIT
Homepage https://github.com/rezahmady/setting-operation
Informations about the package setting-operation
SettingOperation
Backpack Setting Operation to save customize settings for each CRUD. Uses Backpackforlaravel. Works on Laravel 5.2 to Laravel 10.
Backpackforlaravel is cool admin panel for laravel.
Many times it is necessary to make settings for some CRUDs, for example, for the transactions CRUD, you need bank port settings, or for product management, you need settings related to transportation, taxes, etc.
You can even make many of your backpack settings dynamic with this add-on.
Installation
Via Composer
publish vendor :
migrate add-on table :
Why do you need this add-on ?
If you, like me, believe that each CRUD can be a separate module, then having the settings for each crud (module) is important.
The backpack has a settings add-on that I don't think is practical at all.Funny, you have to save the fields as json in the database. But in this add-on, like other operations such as CreateOperation and UpdateOperation, easily use the all backpack fields.
Usage
Step 1. In your CrudController, use the operation trait:
<?php
namespace App\Http\Controllers\Admin;
use Backpack\CRUD\app\Http\Controllers\CrudController;
class ProductCrudController extends CrudController
{
use \Rezahmady\SettingOperation\SettingOperation;
Step 2. In your CrudController, add setupSettingOperation method and add your custom backpack fields:
/**
* Define what happens when the Setting operation is loaded.
*
* @see https://github.com/rezahmady/setting-operation
* @return void
*/
protected function setupSettingOperation()
{
// backpack fields
}
Step 3. To call the value of each field, you must use the Setting facade:
use Rezahmady\SettingOperation\Setting;
Setting::get(CRUD_TABLE_NAME.FIELD_NAME, DEFAULT);
fast update field To update or set new field you can use this:
use Rezahmady\SettingOperation\Setting;
Setting::set(CRUD_TABLE_NAME.FIELD_NAME, VALUE);
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Reza Ahmadi Sabzevar
- All Contributors
License
MIT. Please see the license file for more information.