From 278e36ff70f7293418459f63072690439bbd3827 Mon Sep 17 00:00:00 2001 From: Bishwajit Adhikary Date: Tue, 1 Aug 2023 03:14:50 +0600 Subject: [PATCH] Migrate + Optimize --- src/Installer.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Installer.php b/src/Installer.php index 83a5052..e383411 100755 --- a/src/Installer.php +++ b/src/Installer.php @@ -6,6 +6,7 @@ use Exception; use GuzzleHttp\Promise\PromiseInterface; use Illuminate\Http\Client\Response; +use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Storage; use ZipArchive; @@ -90,6 +91,10 @@ public function update(): void } $this->updateVersion($files['version']); + + $this->runMigrations(); + + $this->optimizeApplication(); } /** @@ -245,4 +250,16 @@ private function updateVersion(mixed $version): void flash(trans('Failed to upgrade the application'), 'error'); } } + + private function runMigrations(): void + { + Artisan::call('migrate', [ + '--force' => true, + ]); + } + + private function optimizeApplication(): void + { + Artisan::call('optimize:clear'); + } }