Skip to content

Commit a4a53ab

Browse files
authoredAug 21, 2024··
fix(laravel): identitifer is not writable unless marked as writable (#6531)
1 parent 8c79d89 commit a4a53ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/Laravel/Eloquent/Metadata/Factory/Property/EloquentPropertyMetadataFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function create(string $resourceClass, string $property, array $options =
5959
}
6060

6161
if ($model->getKeyName() === $property) {
62-
$propertyMetadata = $propertyMetadata->withIdentifier(true);
62+
$propertyMetadata = $propertyMetadata->withIdentifier(true)->withWritable($propertyMetadata->isWritable() ?? false);
6363
}
6464

6565
foreach ($this->modelMetadata->getAttributes($model) as $p) {

0 commit comments

Comments
 (0)
Please sign in to comment.