public function handle()

in app/Console/Commands/Update.php [56:113]


    public function handle(): void
    {
        if ($this->confirmToProceed()) {
            try {
                $this->commandExecutor->artisan('✓ Maintenance mode: on', 'down', [
                    '--message' => 'Upgrading Monica v'.config('monica.app_version'),
                    '--retry' => '10',
                ]);

                // Clear or rebuild all cache
                if (config('cache.default') != 'database' || Schema::hasTable(config('cache.stores.database.table'))) {
                    $this->commandExecutor->artisan('✓ Resetting application cache', 'cache:clear');
                }

                if ($this->getLaravel()->environment() == 'production') {
                    $this->commandExecutor->artisan('✓ Clear config cache', 'config:clear');
                    $this->commandExecutor->artisan('✓ Resetting route cache', 'route:cache');
                    if ($this->getLaravel()->version() > '5.6') {
                        $this->commandExecutor->artisan('✓ Resetting view cache', 'view:cache');
                    } else {
                        $this->commandExecutor->artisan('✓ Resetting view cache', 'view:clear');
                    }
                } else {
                    $this->commandExecutor->artisan('✓ Clear config cache', 'config:clear');
                    $this->commandExecutor->artisan('✓ Clear route cache', 'route:clear');
                    $this->commandExecutor->artisan('✓ Clear view cache', 'view:clear');
                }

                if ($this->option('composer-install') === true) {
                    $this->commandExecutor->exec('✓ Updating composer dependencies', 'composer install --no-interaction --no-suggest --ignore-platform-reqs'.($this->option('dev') === false ? ' --no-dev' : ''));
                }

                if ($this->option('skip-storage-link') !== true && $this->getLaravel()->environment() != 'testing' && ! file_exists(public_path('storage'))) {
                    $this->commandExecutor->artisan('✓ Symlink the storage folder', 'storage:link');
                }

                if ($this->migrateCollationTest()) {
                    $this->commandExecutor->artisan('✓ Performing collation migrations', 'migrate:collation', ['--force']);
                }

                $this->commandExecutor->artisan('✓ Performing migrations', 'migrate', ['--force']);

                $this->commandExecutor->artisan('✓ Check for encryption keys', 'monica:passport', ['--force']);

                $this->commandExecutor->artisan('✓ Ping for new version', 'monica:ping', ['--force']);

                // Cache config
                if ($this->getLaravel()->environment() == 'production'
                    && (config('cache.default') != 'database' || Schema::hasTable(config('cache.stores.database.table')))) {
                    $this->commandExecutor->artisan('✓ Cache configuraton', 'config:cache');
                }
            } finally {
                $this->commandExecutor->artisan('✓ Maintenance mode: off', 'up');
            }

            $this->line('Monica v'.config('monica.app_version').' is set up, enjoy.');
        }
    }