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

feat: support strict models by handling MissingAttributeException #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maartenpaauw
Copy link

This update ensures compatibility with Laravel's Model::shouldBeStrict() feature.

For example, the following code may throw a MissingAttributeException if any defined attribute event attributes are not fetched:

Order::query()->pluck('status', 'id');

To address this, each getAttribute() call is now wrapped in a try-catch block, preventing exceptions and maintaining functionality in strict mode.

This update ensures compatibility with Laravel's `Model::shouldBeStrict()` feature.

For example, the following code may throw a `MissingAttributeException` if any defined attribute event attributes are not fetched:

```php
Order::query()->pluck('status', 'id');
```

To address this, each `getAttribute()` call is now wrapped in a try-catch block, preventing exceptions and maintaining functionality in strict mode.
@maartenpaauw
Copy link
Author

Hi @jpkleemans, I hope you’re doing well! Just a kind reminder to take a look at this when you have a moment. The changes address compatibility issues with Filament PHP in strict mode due to the pluck operations.

Please let me know if there’s anything I can do to help with the review process. Thanks so much for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant