From c1ba2ef8d1b2eaa4674a24841f011bbd54b9bd2a Mon Sep 17 00:00:00 2001 From: GIGABAIT <59637348+GIGABAIT93@users.noreply.github.com> Date: Tue, 31 Jan 2023 13:07:52 +0200 Subject: [PATCH] Update CommandsServiceProvider.php --- src/CommandsServiceProvider.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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')); - // }); - // } + }); + } } /**