Closed
Description
Laravel Version
12.10.1
PHP Version
8.4
Database Driver & Version
No response
Description
After merging #55471, a regression was introduced in how manually set relations are handled via setRelations()
. Behavior that previously returned null
now results in a fatal error.
Attempts to address this in #55518 and #55519 do not fully restore the expected behavior.
Steps To Reproduce
$model = new class extends Model {};
$model->setRelations(['many' => ['one', 'two', 'three' => 84]]);
$result = $model->getAttribute('many.three');
✅ Expected behavior:
In versions prior to 12.10.1
, this would return null
.
❌ Actual behavior:
As of 12.10.1
(and with the mentioned PRs applied), the following error is thrown:
Error: Call to a member function relationLoaded() on null
Metadata
Metadata
Assignees
Labels
No labels