Skip to content

Commit

Permalink
Add config option to disable migration auto registration (#116)
Browse files Browse the repository at this point in the history
Co-authored-by: atymic <[email protected]>
  • Loading branch information
pxlrbt and atymic authored Mar 20, 2024
1 parent 7efbf33 commit 082d282
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions config/snooze.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@
* Should snooze automatically schedule the snooze:send and snooze:prune commands
*/
'scheduleCommands' => env('SCHEDULED_NOTIFICATIONS_SCHEDULE_COMMANDS', true),

/*
* Should snooze automatically register the migrations
*/
'registerMigrations' => env('SCHEDULED_NOTIFICATIONS_REGISTER_MIGRATIONS', true),
];
4 changes: 3 additions & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public function boot()
self::CONFIG_PATH => config_path('snooze.php'),
], 'config');

$this->loadMigrationsFrom(__DIR__.'/../migrations');
if (config('snooze.registerMigrations', true)) {
$this->loadMigrationsFrom(__DIR__.'/../migrations');
}

if ($this->app->runningInConsole()) {
$this->commands($this->commands);
Expand Down

0 comments on commit 082d282

Please sign in to comment.