Settings loading as null unless I access them first. #75
Unanswered
argonzalez2016
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Actually this only happens when I use empty(). When I use is_null() everything works as intended. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When I load a settings class, my settings are null until I access at least one of the properties first. How do I fix this?
Example:
$setting = app(SettingClass::class); dump(empty($setting->someSetting))
This outputs True.
However when i do it this way
$setting = app(SettingClass::class) echo $setting->someSetting; dump(empty($setting->someSetting));
I get the proper value: False.
Any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions