PHP code example of geniusts / preferences

1. Go to this page and download the library: Download geniusts/preferences 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/ */

    

geniusts / preferences example snippets


    GeniusTS\Preferences\PreferencesServiceProvider::class,

    use GeniusTS\Preferences\Models\Domain;
    use GeniusTS\Preferences\Models\Element;
    
    // Create a settings Domain
    // Domain(string $key, View $view, string $label)
    // you can use label like 'labels.general', because the view execute "trans" function
    $domain = new Domain('general', view('settings.general'), 'General');
    
    // Add the inputs names and validation rules
    // Element(string $name, mixed $rules)
    $domain->addElement(new Element('project_name', '

config('preferences.general.project_name');

   public function edit($domain = null) {
        // Logic here
   }
       
    protected function handleSuccessResponse($domain, $element) {
        // Logic here    
    }