1. Go to this page and download the library: Download codewiser/laravel-scout 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/ */
use Codewiser\Scout\Attributes\MeilisearchFilterableAttributes;
use Codewiser\Scout\Attributes\MeilisearchSortableAttributes;
use Laravel\Scout\Searchable;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
use Searchable;
#[MeilisearchFilterableAttributes(['id', 'name', 'email'])]
#[MeilisearchSortableAttributes(['created_at'])]
public function toSearchableArray()
{
return $this->toArray();
}
}