PHP code example of lee-to / moonshine-algolia-search
1. Go to this page and download the library: Download lee-to/moonshine-algolia-search 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/ */
lee-to / moonshine-algolia-search example snippets
use Illuminate\Database\Eloquent\Model;
use Leeto\MoonShineAlgoliaSearch\Contracts\HasGlobalAlgoliaSearch;
class Post extends Model implements HasGlobalAlgoliaSearch
{
public function globalSearch(): array
{
return [
'description' => $this->text,
'image' => $this->thumbnail
];
}
}