File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -145,22 +145,22 @@ protected function loadAllProviders(): void
145145 */
146146 protected function loadProvidersForModule (array $ module ): void
147147 {
148- // Load providers from module.json first (explicit providers )
149- foreach ($ module ['providers ' ] ?? [] as $ providerClass )
148+ // 1. Load files FIRST (helper files, etc. )
149+ foreach ($ module ['files ' ] ?? [] as $ file )
150150 {
151- if (class_exists ($ providerClass ))
151+ $ filePath = $ module ['path ' ].'/ ' .mb_ltrim ($ file , '/ ' );
152+ if (file_exists ($ filePath ))
152153 {
153- $ this -> app -> register ( $ providerClass ) ;
154+ require_once $ filePath ;
154155 }
155156 }
156157
157- // Load files from module.json (helper files, etc.)
158- foreach ($ module ['files ' ] ?? [] as $ file )
158+ // 2. Load providers SECOND
159+ foreach ($ module ['providers ' ] ?? [] as $ providerClass )
159160 {
160- $ filePath = $ module ['path ' ].'/ ' .mb_ltrim ($ file , '/ ' );
161- if (file_exists ($ filePath ))
161+ if (class_exists ($ providerClass ))
162162 {
163- require_once $ filePath ;
163+ $ this -> app -> register ( $ providerClass ) ;
164164 }
165165 }
166166
You can’t perform that action at this time.
0 commit comments