Answer the question
In order to leave comments, you need to log in
Why doesn't scout:import work?
There is a table with various fields + searchable field.
Model code:
use Searchable;
protected $table = "okved_h_section";
public $timestamps = false;
protected $fillable = [
'id',
'name',
'code',
'searchable'
];
public function searchableAs()
{
return "okved_h_section";
}
public function toSearchableArray()
{
$array = [
'section' => $this->code,
'title_section' => $this->name
];
return $array;
}
php artisan scout:import "\App\Models\OkvedSection"
Illuminate\Database\QueryException : SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "okved_h_section" does not exist
LINE 1: update "okved_h_section" set "searchable" = $1 where "id" = ...
^ (SQL: update "okved_h_section" set "searchable" = 'лесн':2 'охот':4 'рыбоводств':7 'рыболовств':5 'сельск':1 'хозяйств':3 where "id"
= 1)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question