Skip to content

Commit

Permalink
feat: add disableable migrations to individual packages
Browse files Browse the repository at this point in the history
  • Loading branch information
dotmbf committed Jan 13, 2025
1 parent 1952a4a commit a9a8c56
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/admin/src/LunarPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public function register(): void

public function boot(): void
{
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
if (! config('lunar.database.disable_migrations', false)) {
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}

$this->loadViewsFrom(__DIR__.'/../resources/views', 'lunarpanel');

Expand Down
4 changes: 3 additions & 1 deletion packages/opayo/src/OpayoServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public function boot()

$this->loadRoutesFrom(__DIR__.'/../routes/web.php');

$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
if (! config('lunar.database.disable_migrations', false)) {
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}

Blade::directive('opayoScripts', function ($incVendor = true) {
$url = 'https://sandbox.opayo.eu.elavon.com/api/v1/js/sagepay.js';
Expand Down
6 changes: 5 additions & 1 deletion packages/stripe/src/StripePaymentsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ public function boot()

$this->loadViewsFrom(__DIR__.'/../resources/views', 'lunar');
$this->loadRoutesFrom(__DIR__.'/../routes/webhooks.php');
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');

if (! config('lunar.database.disable_migrations', false)) {
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}

$this->mergeConfigFrom(__DIR__.'/../config/stripe.php', 'lunar.stripe');

$this->publishes([
Expand Down
4 changes: 3 additions & 1 deletion packages/table-rate-shipping/src/ShippingServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public function boot(ShippingModifiers $shippingModifiers)

$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'lunarpanel.shipping');

$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
if (! config('lunar.database.disable_migrations', false)) {
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}

$this->loadViewsFrom(__DIR__.'/../resources/views', 'shipping');

Expand Down

0 comments on commit a9a8c56

Please sign in to comment.