Replies: 4 comments 1 reply
-
@taylorotwell @driesvints please let’s discuss it further. |
Beta Was this translation helpful? Give feedback.
-
Without changing Laravel itself, there is a way to avoid this bug, but it still has a hidden issue with this workaround.
By doing this, we no longer use the database and thus avoid the error. However, the problem is that the setting is being called before the Each time the setting is called, new instances of the classes required by this package are being created, which makes the singleton pattern defined in this provider meaningless, right? |
Beta Was this translation helpful? Give feedback.
-
well, you need the configuration to access the database in the first place, so logically the configuration gets loaded first. I suggest you change the way your package works, and load the configuration stored in the database in a service provider. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
10.37.1
PHP Version
8.1.13
Database Driver & Version
MySQL 5.7
Description
This error occurs because all configs are loaded at the start of Laravel’s boot process, which creates a limitation for using the configs in Laravel. I have resolved this issue in a pull request at the link below, but I think I did not communicate my point well and it got rejected.
pull requests : #49313
Please advise if you have a better solution to this problem!
Please don’t close this issue quickly; let’s discuss it further as it is very important to me.
Steps To Reproduce
Installation of the
laravel-setting-pro
package.I wrote this package myself and am completely confident in it!
GitHub package link: https://github.com/sajadsdi/laravel-setting-pro
Before installation, we deactivate optimization!
Ctrl + C
on terminalCtrl + C
on terminalcustom.php
and save it as follows:And we encounter this error!
And here is the
laravel.log
fileFull error
Beta Was this translation helpful? Give feedback.
All reactions