Exemplo n.º 1
0
 public function handle()
 {
     //Artisan::call('scout:flush', ['model' => Product::class]);
     // scout's own clear command only clears the currently existing products
     $algolia = new Algolia(config('scout.algolia.id'), config('scout.algolia.secret'));
     $product = new Product();
     $index = $algolia->initIndex($product->searchableAs());
     $index->clearIndex();
     Artisan::call('scout:import', ['model' => Product::class]);
 }