Skip to content

Instantly share code, notes, and snippets.

@thehelvetian
Forked from luckys383/User.php
Created June 14, 2019 01:17
Show Gist options
  • Save thehelvetian/994467680e3e8cda67b31b4998d5cc9e to your computer and use it in GitHub Desktop.
Save thehelvetian/994467680e3e8cda67b31b4998d5cc9e to your computer and use it in GitHub Desktop.
<?php
namespace App;
use App\Models\AppModel;
use App\Traits\FilterTrait;
class User extends AppModel
{
use FilterTrait;
protected $table = 'users';
/**
* set fillable fields
*/
protected $fillable = ['role_id', 'name', 'email', 'status'];
/**
* set string fields for filtering
* @var array
*/
protected $likeFilterFields = ['name', 'email'];
/**
* set boolean fields for filtering
* @var array
*/
protected $boolFilterFields = ['status'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment