-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capitalize "app" in namespace in settings classes generated with Artisan console #196
Comments
Isn't this solved with this PR: #190? |
That PR is definitely discussing the same issue, but I'm looking at the commit, and it doesn't actually solve anything. Line 113 in MakeSettingCommand.php: Looking at this line of code,
|
You're always welcome sending in a PR fixing this! |
Still not solved.. and still getting Hopefully soon and thanks guys for the great set of Libraries. |
Cannot reproduce on newest version: a make:setting SomeSettings <?php
namespace App\Settings;
use Spatie\LaravelSettings\Settings;
class SomeSettings extends Settings
{
public static function group(): string
{
return 'default';
}
} Looks fine to me, we had a lot of PR's recently to the commands so maybe someone fixed it. Otherwise you're still free to send in a PR fixing this issue. |
I made PR #200 specifically to fix this, so yes it is resolved ;) |
When generating settings classes with the
make:setting
Artisan command, the namespace of the class defaults toapp\Settings
instead ofApp\Settings
like all other files generated through Artisan commands. This isn't usually a problem, but it led to some confusion when it comes to caching the settings class.Assuming it would be capitalized, I wrote a helper function that loads my main site settings class using
app(App\Settings\SiteSettings::class)
. This returns the class just fine, but since the namespace of the settings class was defined asapp\Settings
, the values of the settings class were cached with the keysettings.app\Settings\SiteSettings
. I am using Redis for caching, where the keys are case sensitive, so it ends up looking forsettings.App\Settings\SiteSettings
in the cache and can't find anything.The text was updated successfully, but these errors were encountered: