File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/database/src/Builder Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -412,15 +412,15 @@ public function getPrimaryKeyProperty(): ?PropertyReflector
412412 return null ;
413413 }
414414
415- $ idProperties = arr ($ this ->reflector ->getProperties ())
416- ->filter (fn (PropertyReflector $ property ) => $ property ->getType ()->getName () === PrimaryKey::class);
415+ $ primaryKeys = arr ($ this ->reflector ->getProperties ())
416+ ->filter (fn (PropertyReflector $ property ) => $ property ->getType ()->matches ( PrimaryKey::class) );
417417
418- return match ($ idProperties ->count ()) {
418+ return match ($ primaryKeys ->count ()) {
419419 0 => null ,
420- 1 => $ idProperties ->first (),
420+ 1 => $ primaryKeys ->first (),
421421 default => throw ModelHadMultiplePrimaryColumns::found (
422422 model: $ this ->model ,
423- properties: $ idProperties ->map (fn (PropertyReflector $ property ) => $ property ->getName ())->toArray (),
423+ properties: $ primaryKeys ->map (fn (PropertyReflector $ property ) => $ property ->getName ())->toArray (),
424424 ),
425425 };
426426 }
You can’t perform that action at this time.
0 commit comments