Skip to content

Commit

Permalink
fix(laravel): fix use laravel fillable for writable props
Browse files Browse the repository at this point in the history
Closes: api-platform#6875
Signed-off-by: Tobias Oitzinger <tobiasoitzinger@gmail.com>
  • Loading branch information
toitzi committed Jan 8, 2025
1 parent c0c3f4c commit 8716728
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function create(string $resourceClass, string $property, array $options =

return $propertyMetadata
->withBuiltinTypes([$type])
->withWritable($propertyMetadata->isWritable() ?? true)
->withWritable($propertyMetadata->isWritable() ?? true === $p['fillable'])
->withReadable($propertyMetadata->isReadable() ?? false === $p['hidden']);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Laravel/workbench/app/Models/Book.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Book extends Model
use HasUlids;

protected $visible = ['name', 'author', 'isbn', 'publication_date', 'is_available'];
protected $fillable = ['name', 'is_available'];
protected $fillable = ['name', 'publication_date', 'isbn', 'is_available'];
protected $casts = [
'is_available' => 'boolean',
];
Expand Down

0 comments on commit 8716728

Please sign in to comment.