From 653ddde69cacf82c9ab0c9642561782aea659696 Mon Sep 17 00:00:00 2001 From: Marc Jauvin Date: Wed, 27 Nov 2024 15:07:46 -0500 Subject: [PATCH] run migrations in ServiceManager boot method --- modules/backend/ServiceProvider.php | 32 ++++++++++++++++++++++++----- modules/backend/models/User.php | 17 --------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/modules/backend/ServiceProvider.php b/modules/backend/ServiceProvider.php index c81552de9d..ebd3aa3e93 100644 --- a/modules/backend/ServiceProvider.php +++ b/modules/backend/ServiceProvider.php @@ -1,13 +1,21 @@ update(); + } catch (Exception $e) { + Flash::error($e->getMessage()); + } + } + // Log the sign in event + AccessLog::add($user); + }); } /** diff --git a/modules/backend/models/User.php b/modules/backend/models/User.php index cc5b24a4b7..37c8892a18 100644 --- a/modules/backend/models/User.php +++ b/modules/backend/models/User.php @@ -2,13 +2,8 @@ use Backend\Facades\Backend; use Backend\Facades\BackendAuth; -use Backend\Models\AccessLog; -use Exception; use Illuminate\Support\Facades\Event; -use System\Classes\UpdateManager; use Winter\Storm\Auth\Models\User as UserBase; -use Winter\Storm\Support\Facades\Config; -use Winter\Storm\Support\Facades\Flash; use Winter\Storm\Support\Facades\Mail; /** @@ -160,18 +155,6 @@ public function afterLogin() * */ Event::fire('backend.user.login', [$this]); - - $runMigrationsOnLogin = (bool) Config::get('cms.runMigrationsOnLogin', Config::get('app.debug', false)); - if ($runMigrationsOnLogin) { - try { - // Load version updates - UpdateManager::instance()->update(); - } catch (Exception $e) { - Flash::error($e->getMessage()); - } - } - // Log the sign in event - AccessLog::add($this); } /**