Skip to content

[BUG] Relation with name model returns itself as type #104

Description

@Livijn

What happened?

In my models/Payment.php:

public function model(): MorphTo|Model
{
    return $this->morphTo();
}

I have tried adding an interface and another return type as well:

public static array $interfaces = [
    'model' => ['type' => 'Listing|PetPurchase'],
];

public function model(): MorphTo|Listing|PetPurchase
{
    return $this->morphTo();
}

Either way it returns:

export interface Payment {
  model: Payment
}

Expected Behavior

No response

Steps To Reproduce

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions