Closed renatosistemasvc closed 5 years ago
I'm using teamtnt / laravel-scout-tntsearch-driver I followed the documentation example and did not try to capture my model's relationships.
How can I search the products and the relation "One To Many" of marks?
public function toSearchableArray() { return [ 'id' => $this->id, 'name' => $this->name, 'mark' => $this->mark['name'] ]; } public function mark() { return $this->belongsTo('App\Models\Marca'); }
search
Product::search($filter)->get()->toArray();
When I run, I do not have the marks.
I'm using teamtnt / laravel-scout-tntsearch-driver I followed the documentation example and did not try to capture my model's relationships.
How can I search the products and the relation "One To Many" of marks?
search
Product::search($filter)->get()->toArray();
When I run, I do not have the marks.