Skip to content

Commit 439c188

Browse files
authoredOct 11, 2024··
fix(laravel): match integer type (#6715)
1 parent a5b6c6a commit 439c188

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

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

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function create(string $resourceClass, string $property, array $options =
7171
// see https://laravel.com/docs/11.x/eloquent-mutators#attribute-casting
7272
$builtinType = $p['cast'] ?? $p['type'];
7373
$type = match ($builtinType) {
74+
'integer' => new Type(Type::BUILTIN_TYPE_INT, $p['nullable']),
7475
'double', 'real' => new Type(Type::BUILTIN_TYPE_FLOAT, $p['nullable']),
7576
'datetime', 'date', 'timestamp' => new Type(Type::BUILTIN_TYPE_OBJECT, $p['nullable'], \DateTime::class),
7677
'immutable_datetime', 'immutable_date' => new Type(Type::BUILTIN_TYPE_OBJECT, $p['nullable'], \DateTimeImmutable::class),

0 commit comments

Comments
 (0)
Please sign in to comment.