PHP code example of fefo-p / laravel-user-preferences

1. Go to this page and download the library: Download fefo-p/laravel-user-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/ */

    

fefo-p / laravel-user-preferences example snippets


    'database' => [
        'table' => 'users',
        'column' => 'preferences',
        'primary_key' => 'id'
    ],
    'defaults' => [
        'theme' => 'blue',
        'show_welcome' => true
    ]

UserPreferences::set(string [setting], [value]);

UserPreferences::setDefaultPreferences();

UserPreferences::reset(string [setting]);

UserPreferences::get(string [setting]);

UserPreferences::all()

UserPreferences::has(string [setting]);

    php artisan vendor:publish --provider="FefoP\LaravelUserPreferences\UserPreferencesServiceProvider" --tag="config"
    

    php artisan vendor:publish --provider="FefoP\LaravelUserPreferences\UserPreferencesServiceProvider" --tag="migrations" && php artisan migrate