Skip to content
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

all() method not working on Model #65

Closed
ghost opened this issue Jun 29, 2024 · 1 comment
Closed

all() method not working on Model #65

ghost opened this issue Jun 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jun 29, 2024

Laravel Settings

latest

Laravel Version

11.x

Bug description

I am trying to get all settings for a user.

$user = Auth::user();
dd($user->settings()->all());

Returns an empty collection.

Illuminate\Support\Collection {#2596 ▼
  #items: []
  #escapeWhenCastingToString: false
}

but this works:

   dd($user->settings()->context('user')->all());

So it looks like the context is not applied automatically when calling settings()->all() on the User model.

Steps to reproduce

No response

Relevant log output

No response

@ghost ghost added the bug Something isn't working label Jun 29, 2024
@rawilk
Copy link
Owner

rawilk commented Oct 16, 2024

I believe this is related to #49. Using the DotNotationContextSerializer should resolve this issue for you.

I'm going to close this issue, but feel free to re-open if that serializer doesn't help with this.

@rawilk rawilk closed this as completed Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant