mongodb / laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)

Home Page:https://www.mongodb.com/compatibility/mongodb-laravel-integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Polymorphic One to One (MorphOne) Relationship [Feature Request]

mrraindrop555 opened this issue · comments

This is already supported using morphOne().

Could you describe what you'd like to do, what you've tried and any errors you've encountered?

I tried importing the relationship but found VS code keep highlighting this problem.
Undefined type 'MongoDB\Laravel\Relations\MorphOne'

It works with other polymorphic relationships.

You can use Illuminate\Database\Eloquent\Relations\MorphOne.