Closed camerongermein closed 1 month ago
You should be able to use all
with context. I'll look into this further to see if I can replicate it.
Hi, I just found this package which seems good for my needs but I have the same problem.
// Storing settings
$context = new Context(['user_id' => $request->get('user_id']);
$request->get('settings')->each(function($value, $key) use($context) {
Settings::context($context)->set($key, $value);
});
// -> Settings are good in DB
// Retrieving settings
$context = new Context(['user_id' => $user->id]);
$settings = settings()->context($context)->all();
// -> $settings is an empty Collection
I would be nice if $settings where well filled correctly 👍
I am currently experiencing this, please what is the solution
I haven't had a chance to look into this issue yet, so if someone is able to resolve the issue before I do, please feel free to PR a fix for it. I plan on trying to fix it at some point; just not sure when I'll be able to.
resolved with changing context_serializer
to DotNotationContextSerializer
ContextSerializer
value not saving to DB correctly
Using the DotNotationContextSerializer
should be the solution to this, as pointed out by @KolyaSirik. I'll update the docs to mention this.
I'm going to close this issue, but feel free to re-open if using that serializer doesn't work for you.
Laravel Settings
3.3.0
Laravel Version
v10.26.2
Bug description
Not sure if I'm doing something wrong, or this isn't supported? The documentation doesn't seem to specify.
Steps to reproduce
Using the code above, execute it with the context of any simple Eloquent Model.
Relevant log output
No response