我是下一個指令安裝Laravel偵察兵,但我使用了一個問題:(Laravel Algolia搜索
1)命令composer require laravel/scout
2)添加到供應商部分'Laravel\Scout\ScoutServiceProvider::class,'
3)使用命令php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
4)添加了擴展
Laravel\Scout\Searchable
use Searchable;
5)使用命令composer require algolia/algoliasearch-client-php
6)模型代碼:
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Laravel\Scout\Searchable;
use DB;
class Product extends Model
{
use Searchable;
protected $table = 'products';
public static function getProductsBySearch($search)
{
// Список найденных продуктов
$searchProducts = Product::search('Test')
->get()
->all();
return $searchProducts;
}
}
,但有錯誤:
AlgoliaSearch requires an applicationID
什麼是Algolia?如何解決它的問題?