Skip to content

Setting belongsTo in Laravel to Eloquent Model #32

Open
@b-t-927

Description

@b-t-927

After updating an existing model in laravel to make use of ApiWrapper, I'm unable to load any belongsTo relationships from the model object that gets created. Trying to access them causes the following exception:

TypeError: Cristal\ApiWrapper\Relations\BelongsTo::__construct(): Argument #2 ($related) must be of type Cristal\ApiWrapper\Model, App\Models\User given

Is it possible to have a bridged model belong to an existing Eloquent model and I'm just missing something configuration-wise?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions