diff --git a/database/migrations/2023_12_06_124752_migrate_oci_tables.php b/database/migrations/2023_12_06_124752_migrate_oci_tables.php index 801f266..8e07fb7 100644 --- a/database/migrations/2023_12_06_124752_migrate_oci_tables.php +++ b/database/migrations/2023_12_06_124752_migrate_oci_tables.php @@ -24,6 +24,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Storage; +use Illuminate\Support\ItemNotFoundException; use Illuminate\Support\Str; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Output\ConsoleOutput; @@ -140,7 +141,7 @@ return new class extends Migration ->explode(PHP_EOL)->map(fn (string $other_allegation) => Str::of($other_allegation)->squish()) ->unique(); - $MOTKS = Keyword::all(); + $MOTKS = Keyword::query()->where('keyword_cat', 'LIKE', 'product_%')->get(); /** @var \Illuminate\Support\Collection */ $START_SOURCES = $this->getQuery('SOURCE')->get(); /** @var \Illuminate\Support\Collection */ @@ -239,7 +240,7 @@ return new class extends Migration fn (Keyword $keyword) => Str::of($keyword->label)->ascii()->replace(' ', '') == Str::of($motk)->trim()->ascii()->replace(' ', '') ); - } catch (\Exception) { + } catch (ItemNotFoundException) { dump( $motk, $MOTKS->pluck('label')