Skip to content

Workaround for Laravel 12.10.1 relation loading regression in getAttribute() #3006

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

Merged
merged 2 commits into from
Apr 24, 2025

Conversation

tabuna
Copy link
Member

@tabuna tabuna commented Apr 24, 2025

This patch introduces a compatibility fix for a behavior change in Laravel introduced in laravel/framework#55471, where getAttribute('relation.key') would previously return null if the relation was a plain array, but now throws an exception.

Example:

$model->setRelations([
    'many' => [
        'one',
        'two',
        'three' => 84,
    ]
]);

$value = $model->getAttribute('many.three');
// Previously returned null, now throws

@tabuna tabuna merged commit 6dae96b into master Apr 24, 2025
45 of 46 checks passed
@tabuna tabuna deleted the relation_test branch April 24, 2025 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant