PHP code example of it-devgroup / laravel-setting-lite

1. Go to this page and download the library: Download it-devgroup/laravel-setting-lite 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/ */

    

it-devgroup / laravel-setting-lite example snippets


php artisan setting:publish --tag=config

php artisan setting:publish --tag=lang

php artisan setting:publish --tag=migration

php artisan migrate

        \ItDevgroup\LaravelSettingLite\Providers\SettingServiceProvider::class,

    'providers' => [
        ...
        \ItDevgroup\LaravelSettingLite\Providers\SettingServiceProvider::class,
    ]

php artisan vendor:publish --provider="ItDevgroup\LaravelSettingLite\Providers\SettingServiceProvider" --tag=config

php artisan vendor:publish --provider="ItDevgroup\LaravelSettingLite\Providers\SettingServiceProvider" --tag=lang

php artisan setting:publish --tag=migration

php artisan migrate

php artisan setting:sync



namespace App;

class CustomFile extends \ItDevgroup\LaravelSettingLite\Model\Setting
{
}



namespace App;

class CustomFile extends \ItDevgroup\LaravelSettingLite\Model\Setting
{    
    // other code
}

$array = $service->getTypes();

$array = $service->getGroups();

$eloquentCollection = $service->getList(null, $fieldName, $ascOrDesc);
$eloquentCollection = $service->getList(null, 'key', 'ASC');

$setting = \ItDevgroup\LaravelSettingLite\Model\Setting::register(
    'key_1',
    'test value',
    'text',
    'Test'
);
$setting->options = ['val1', 'val2'];
$setting->is_public = true;
$service->createModel($setting);