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 ff8aa6d..801f266 100644 --- a/database/migrations/2023_12_06_124752_migrate_oci_tables.php +++ b/database/migrations/2023_12_06_124752_migrate_oci_tables.php @@ -99,13 +99,12 @@ return new class extends Migration $this->fixForeignKeyActionOnProcesses(); // ! DEV: Comment this after running once, to develop a migration without remigrating every temp table. - $this->createAndFillTempTables(); + // $this->createAndFillTempTables(); // * Migrate PRODUCTS, comment all except the one you want to develop here. $this->migrateBrands(); $this->migrateProducts(); - // ! DEV: Add a die here to develop migration and prevent droping temp tables // dd(''); @@ -347,7 +346,9 @@ return new class extends Migration // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed $pictureKey = $files ? $files->map(fn (string $filePath, string $fileName) => $fileName) - ->first(fn ($fileName) => preg_match('/ref-[0-9a-z]*.jpg/', $fileName) !== false) : null; + ->first(function ($fileName) { + return preg_match('/(ref-?[0-9a-z]{0,}.jpg)/', $fileName) === 1; + }) : null; $picture = $files ? $files->get($pictureKey) : null; if ($files) { $files->pull($pictureKey);