API Platform version(s) affected: 3.*, 4.*
Description
If I use a relation other than HasMany that returns multiple items then the API does not work correctly because it tries to return a single item
How to reproduce
use a HasManyThrough, BelongsToMany, MorphMany, or MorphToMany relation
Possible Solution
In src/Laravel/Eloquent/Metadata/Factory/Property/EloquentPropertyMetadataFactory.php#L96
Change this if statement to include other possible relations that return a collection