1. Go to this page and download the library: Download odoku/eloquent-searcher 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\Models;
use EloquentSearcher\SearchableTrait;
use Illuminate\Database\Eloquent\Model;
use App\Searchers\UserSearcher;
class User extends Model
{
use SearchableTrait;
protected $searcher = UserSearcher::class;
protected $table = 'users';
public $timestamps = true;
protected $fillable = [
'name',
'is_active',
'notes',
];
protected $guarded = [];
public function group()
{
return $this->belongsTo(Group::class);
}
public function projects()
{
return $this->hasMany(Project::class);
}
}