composer require ldc/web-status-checker-laravel remove Old static status checker Fix ImportMedia WIP commands OK many fixes Fix and try to optimize folder component Fix front icons + actions based on icons Favico front fix alert Fix Media upload on depot fix folder component buttons Full front fix with perf due tu vuejs Download medias Navigate within medias superfix Move media + loader isLocked boolean and remove media fix Folder scroll fix arcadia link color red Fix panier show external Tons of fixes back as front REwrited all
41 lines
1,001 B
PHP
41 lines
1,001 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Models\Media;
|
|
use Illuminate\Console\Command;
|
|
|
|
class ReindexElasticOneMedia extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'media:reindexone {media_id}';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Command description';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function handle()
|
|
{
|
|
$mediaID = \strval($this->argument('media_id'));
|
|
$this->info("Reindexation du media $mediaID dans Elasticsearch...");
|
|
/** @var \App\Models\Media */
|
|
if (!($media = Media::withTrashed()->find($this->argument('media_id')))) {
|
|
$this->info("Pas de media $mediaID");
|
|
}
|
|
/** @throws \RuntimeException */
|
|
$media->addToElasticSearch();
|
|
$this->info("Media ID '$mediaID' Ajouté");
|
|
}
|
|
}
|