From 01b51115f09517f287180628b256aa8b68663b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nono=20Mart=C3=ADnez=20Alonso?= Date: Tue, 1 Dec 2020 13:32:06 +0100 Subject: [PATCH] Enable migrations publishing. --- README.md | 12 ++++++++++++ .../Versionable/Providers/ServiceProvider.php | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 0e1bf68..9ffc492 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,18 @@ Run the migrations. php artisan migrate --path=vendor/mpociot/versionable/src/migrations ``` +Alternatively, publish the migrations. + +``` +php artisan vendor:publish --provider="Mpociot\Versionable\Providers\ServiceProvider" --tag="migrations" +``` + +Then customize and run them. + +``` +php artisan migrate +``` + ## Usage diff --git a/src/Mpociot/Versionable/Providers/ServiceProvider.php b/src/Mpociot/Versionable/Providers/ServiceProvider.php index cfb2d35..d7c5c4e 100644 --- a/src/Mpociot/Versionable/Providers/ServiceProvider.php +++ b/src/Mpociot/Versionable/Providers/ServiceProvider.php @@ -27,6 +27,10 @@ public function boot() __DIR__.'/../../../config/config.php' => config_path('versionable.php'), ], 'config'); + $this->publishes([ + __DIR__ . '/../../../migrations/' => database_path('/migrations'), + ], 'migrations'); + // $this->loadMigrationsFrom(__DIR__.'/../../../migrations'); } }