From 96d70c438810fb26f6025e0db5d08e8c5254b98e Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 3 Oct 2023 08:41:53 +0800 Subject: [PATCH] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 8 ++++---- src/Concerns/MigrationGenerator.php | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 97cb661..6de83ff 100644 --- a/composer.json +++ b/composer.json @@ -30,12 +30,12 @@ "php": "^8.1", "composer-runtime-api": "^2.2", "composer/semver": "^3.0", - "illuminate/console": "^10.17", - "illuminate/filesystem": "^10.17" + "illuminate/console": "^10.26", + "illuminate/filesystem": "^10.26" }, "require-dev": { "fakerphp/faker": "^1.21", - "laravel/framework": "^10.17", + "laravel/framework": "^10.26", "laravel/pint": "^1.6", "mockery/mockery": "^1.5.1", "orchestra/testbench-core": "^8.11", @@ -45,7 +45,7 @@ "symfony/yaml": "^6.2" }, "conflict": { - "orchestra/canvas": "<8.9.0", + "orchestra/canvas": "<8.11.0", "orchestra/testbench-core": "<8.2.0" }, "config": { diff --git a/src/Concerns/MigrationGenerator.php b/src/Concerns/MigrationGenerator.php index 5ea73c9..5c512f6 100644 --- a/src/Concerns/MigrationGenerator.php +++ b/src/Concerns/MigrationGenerator.php @@ -15,4 +15,14 @@ protected function createBaseMigrationUsingCanvas(string $table): string "create_{$table}_table", $this->generatorPreset()->migrationPath() ); } + + /** + * Determine whether a migration for the table already exists. + */ + protected function migrationExistsUsingCanvas(string $table): bool + { + return \count($this->files->glob( + $this->laravel->joinPaths($this->generatorPreset()->migrationPath(), '*_*_*_*_create_'.$table.'_table.php') + )) !== 0; + } }