search stuffs

This commit is contained in:
2021-07-03 00:04:27 +05:00
parent bcb27fc265
commit 1647965d46
19 changed files with 62604 additions and 93 deletions
+12
View File
@@ -7,10 +7,12 @@ use GoldSpecDigital\LaravelEloquentUUID\Database\Eloquent\Uuid;
use Illuminate\Database\Eloquent\Model;
use App\Source;
use App\Topic;
use Laravel\Scout\Searchable;
class Article extends Model
{
use Uuid;
use Searchable;
/**
* The "type" of the auto-incrementing ID.
@@ -73,4 +75,14 @@ class Article extends Model
return $this->with('source', 'topics')
->latest("published_date");
}
public function toSearchableArray()
{
return [
'id' => $this->id,
'title' => $this->title,
'body' => implode(" ",$this->body),
'author' => $this->author
];
}
}