modeltyper icon indicating copy to clipboard operation
modeltyper copied to clipboard

[BUG] Relation with name `model` returns itself as type

Open Livijn opened this issue 3 months ago • 1 comments

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

Livijn avatar Sep 17 '25 12:09 Livijn

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 18 '25 01:10 github-actions[bot]