1. Go to this page and download the library: Download aries/laravelsetting library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace App\Http\Controllers;
use Aries\LaravelSetting\Facade\Setting;
class SettingController extends Controller {
public function index(){
#Set Primary Key :
Setting::set('key', 'value', true);
#Set a Setting property:
Setting::set('key', 'value', false, false);
#Get a Stored Setting value or pass default value
$setting['key'] = Setting::get('key', 'default value');
#Get All primary Keys
$settings = Setting::getPrimary();
}
public function store(\Request $request){
#get all settings from an key-value array and store them to database
#example: <input type="text" name="setting['title']">
Setting::store($request->input('setting'));
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.