From 41dd671dad13b29641a9078833e6917b1bb6cb23 Mon Sep 17 00:00:00 2001 From: Yurij Finiv Date: Fri, 25 Sep 2026 17:49:05 +0300 Subject: [PATCH] Load package migrations automatically --- src/LazyPageServiceProvider.php | 1 + tests/MigrationsTest.php | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/MigrationsTest.php diff --git a/src/LazyPageServiceProvider.php b/src/LazyPageServiceProvider.php index 86d8d0b..dace60e 100644 --- a/src/LazyPageServiceProvider.php +++ b/src/LazyPageServiceProvider.php @@ -28,6 +28,7 @@ public function configurePackage(Package $package): void ->hasMigrations([ '2026_09_25_000000_create_lazy_pages_table', ]) + ->runsMigrations() ->hasCommand(ImportLegacyPagesCommand::class); } diff --git a/tests/MigrationsTest.php b/tests/MigrationsTest.php new file mode 100644 index 0000000..bd44f51 --- /dev/null +++ b/tests/MigrationsTest.php @@ -0,0 +1,13 @@ +artisan('migrate:fresh')->assertSuccessful(); + + expect(Schema::hasTable('lazy_pages'))->toBeTrue() + ->and(Schema::hasTable('lazy_page_translations'))->toBeTrue(); +});