-
Notifications
You must be signed in to change notification settings - Fork 12
[Trait] Searchable
Shawn Clake edited this page Feb 6, 2017
·
1 revision
-
Add this trait to a model:
use Clake\UserExtended\Traits\Searchable;
-
Add a protected data member to your model:
protected $searchable = [ 'email', 'name', 'surname', 'username' ];
This contains model attributes to search
-
Utilize the traits search function:
$results = new Model(); return $results->search($phrase);
UserExtended by Shawn Clake with contributions from Quinn Bast