Skip to content

Settings with same key, different user ID's. #34

@zacksmash

Description

@zacksmash
  • LaravelSettings Version: 8.12
  • Laravel Version: 8.1
  • PHP Version: 7.4

Description:

I'm use the same settings key for a global setting (user_id=0) and for a setting that's tied to a user. When attempting to fetch the global setting value, I get the user defined setting, instead. I would anticipate, if I'm not adding the setExtraColumns() to the method, it would default to the global (user_id=0) value.

Steps To Reproduce:

| user_id | key | value |
-------------------------
|   0     | foo | bar   |
|   1     | foo | baz   |

settings()->get('foo') // baz

settings()->setExtraColumns(['user_id' => auth()->id()])->get('foo'); // baz

settings()->setExtraColumns(['user_id' => 0])->get('foo'); // bar

Am I just understanding it wrong, or can the settings method default to uuser_id of 0 first?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions