From 04ee22334ef4af5d67bdb56457bc7db8e43097fb Mon Sep 17 00:00:00 2001 From: blair2004 Date: Mon, 22 Apr 2024 09:09:17 +0000 Subject: [PATCH] Changelog: - Update: ensure autoloaded modules has their routes loaded --- app/Providers/RouteServiceProvider.php | 25 +++++-------------------- config/nexopos.php | 2 +- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index ad859c2f5..a9aa21ad1 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -93,27 +93,12 @@ protected function mapApiRoutes() */ protected function mapModulesRoutes() { - // make module class - $Modules = app()->make( ModulesService::class ); - - foreach ( $Modules->getEnabled() as $module ) { - /** - * We might check if the module is active - */ - - // include module controllers - /** - * @deprecated this inclusion seems useless now - */ - $controllers = Storage::disk( 'ns-modules' )->files( $module[ 'controllers-relativePath' ] ); - - foreach ( $controllers as $controller ) { - $fileInfo = pathinfo( $controller ); - if ( $fileInfo[ 'extension' ] == 'php' ) { - include_once base_path( 'modules' ) . DIRECTORY_SEPARATOR . $controller; - } - } + /** + * @var ModulesService $Modules + */ + $modulesService = app()->make( ModulesService::class ); + foreach ( $modulesService->getEnabledAndAutoloadedModules() as $module ) { $domain = pathinfo( env( 'APP_URL' ) ); /** diff --git a/config/nexopos.php b/config/nexopos.php index 885268dd5..79ce5a401 100644 --- a/config/nexopos.php +++ b/config/nexopos.php @@ -9,7 +9,7 @@ * This is the core version of NexoPOS. This is used to displays on the * dashboard and to ensure a compatibility with the modules. */ - 'version' => '5.2.4-b1', + 'version' => '5.2.4-b2', /** * --------------------------------------------------------------------