Hello. I receive this error when I'm trying to perform basic search. I'm using Laravel 5.4
/// model
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Nicolaslopezj\Searchable\SearchableTrait;
class User extends Authenticatable
{
use SearchableTrait;
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
protected $searchable = [
/**
* Columns and their priority in search results.
* Columns with higher values are more important.
* Columns with equal values have equal importance.
*
* @var array
*/
'columns' => [
'users.name' => 10,
],
];
}
/// controller
public function profile2() {
$users= User::search('majk')->get();
return $users;
}
Hello. I receive this error when I'm trying to perform basic search. I'm using Laravel 5.4
/// model namespace App;
use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; use Nicolaslopezj\Searchable\SearchableTrait;
class User extends Authenticatable { use SearchableTrait; use Notifiable;
}
/// controller public function profile2() { $users= User::search('majk')->get(); return $users; }
Please help.