1. Go to this page and download the library: Download taylornetwork/setting 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;
use Illuminate\Foundation\Auth\User as Authenticatable;
use TaylorNetwork\Setting\Traits\HasSettings;
class User extends Authenticatable
{
use HasSettings;
// ...
}
// Returns the user's value or null
user_setting('key');
// Returns the app's value or null
app_setting('key');
// Returns the user's value or 'defaultValue'
user_setting('key', 'defaultValue');
// Returns the app's value or 'defaultValue'
app_setting('key', 'defaultValue');
// Returns the user's value or 'defaultValue' using the 'api' guard
user_setting('key', 'defaultValue', 'api');
// Will try and get a value from each guard in order
// If a value other than the default value is found it will immediately return it.
// If none is found after using all the guards in the array, the default value is returned.
user_setting('key', 'defaultValue', ['web', 'api']);
namespace App;
use TaylorNetwork\Setting\UserSetting;
class Setting extends UserSetting
{
// --
}
bash
$ php artisan migrate
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.