diff --git a/src/CommandsServiceProvider.php b/src/CommandsServiceProvider.php index 959ca77..d9373f7 100644 --- a/src/CommandsServiceProvider.php +++ b/src/CommandsServiceProvider.php @@ -2,6 +2,7 @@ namespace Wemx\Installer; +use Illuminate\Console\Scheduling\Schedule; use Illuminate\Support\ServiceProvider; use Wemx\Installer\Commands\BackupCommand; use Wemx\Installer\Commands\CreateMySQLUser; @@ -30,13 +31,13 @@ public function boot() $this->publishes([__DIR__ . '/../config/wemx-backup.php' => config_path('wemx-backup.php')], 'wemx-backup'); - // if (config('wemx-backup.autobackup')) { - // $this->app->booted(function () { - // $schedule = app(Schedule::class); - // $schedule->command('backup --action=create --type=all')->cron(config('wemx-backup.autobackup_cron')); + if (config('wemx-backup.autobackup')) { + $this->app->booted(function () { + $schedule = app(Schedule::class); + $schedule->command('backup --action=create --type=all')->cron(config('wemx-backup.autobackup_cron')); - // }); - // } + }); + } } /**