Closed nikocraft closed 4 years ago
For now it can handle only HasOneOrMany relationship, as other ones ask for more complex information that cannot be just in the json, and are not based on a standard json tree.
For Polymorphic, actually we could do something for MorphOne and MorphMany as they are HasOneOrMany relations.
Something clean to do would be to modify the code to use the internal methods of laravel instead of setting manually relations attributes.
I'm not using the package right now, so if you want to do it, I'd be glad to help you if needed, and accept a PR.
Matt'
After looking again at the code, I think that you actually should try for MorphOne and MorphMany relations. If the type is exported, it could import it as well, and it will works!
Let me know.
@mathieutu will it work with morphToMany?
public function settings()
{
return $this->morphToMany(Setting::class, 'settingable');
}
Closing due to inactivity. I let you try and let us know if you found your answers.
Hi Mathieu, can your package export relatioships that are polymorphic in nature?