PHP code example of mrdth / laravel-model-settings
1. Go to this page and download the library: Download mrdth/laravel-model-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/ */
...
use Illuminate\Notifications\Notifiable;
use Mrdth\LaravelModelSettings\Concerns\HasSettings;
class User extends Authenticatable
{
use HasFactory, Notifiable, HasSettings;
...
$users = User::whereSetting('use custom avatar')->get(); // Returns all users with the setting 'use custom avatar'
$users = User::whereSetting('use custom avatar', true)->get(); // Returns all users with the setting 'use custom avatar' set to true