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

"attribute [localeKey] either does not exist" error with using shouldBeStrict() in Laravel 11 #27

Closed
lifegiro opened this issue Sep 30, 2024 · 3 comments · Fixed by #28
Assignees
Labels
bug Something isn't working

Comments

@lifegiro
Copy link

lifegiro commented Sep 30, 2024

I added shouldBeStrict(); in order to prevent lazy Loading across my models in AppServiceProvider class.

Resulting in the following error message:

The attribute [localeKey] either does not exist or was not retrieved for model [Lwwcas\LaravelCountries\Models\Country].

it seems to be in the astronomic / laravel sub package.

Without, it works seamless in getting the countries from db $countries = Country::_all('locale', 'de');

@lwwcas lwwcas self-assigned this Sep 30, 2024
@lwwcas lwwcas added the bug Something isn't working label Sep 30, 2024
@lwwcas
Copy link
Owner

lwwcas commented Sep 30, 2024

Thanks for your contribution @lifegiro

Today I will take some time to update the package and release a version with this fix.

@lwwcas
Copy link
Owner

lwwcas commented Oct 1, 2024

@lifegiro I'm hoping that this fix will solve whatever problem you've been encountering.

Let me know if you have the same problem please

You can update your package version or follow the link to find the new version
https://github.com/lwwcas/laravel-countries/releases/tag/3.5.2

@lwwcas lwwcas closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2024
@lwwcas lwwcas closed this as completed Oct 1, 2024
@lifegiro
Copy link
Author

lifegiro commented Oct 4, 2024

It came across again with a different error note. To void this error, I have moved the Livewire request from mont() function to render() which solved it. Now tit works with having enforced strict to avoid Lazy Loading (n+1). Thank you for this amazing package to simplify developer's life and globalize locations.

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

Successfully merging a pull request may close this issue.

2 participants