1. Go to this page and download the library: Download owowagency/laravel-settings 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/ */
owowagency / laravel-settings example snippets
Route::settings('users', App\Models\User::class);
namespace App\Models;
use Illuminate\Foundation\Auth\User as BaseUser;
use OwowAgency\LaravelSettings\Models\Concerns\HasSettings;
use OwowAgency\LaravelSettings\Models\Contracts\HasSettingsInterface;
class User extends BaseUser implements HasSettingsInterface
{
use HasSettings;
}
$user->settings->getValue('wants_promotion_emails');
// Or
$user->settings->wants_promotion_emails;