<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
class Test extends Model
{
public function owner(): MorphTo
{
return $this->morphTo();
}
}
ide-helper generates the following line for the relation:
* @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $owner
Versions:
Description:
Suppose a model like this:
ide-helper generates the following line for the relation:
* @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $owner
expected:
* @property-read \Illuminate\Database\Eloquent\Model|\Eloquent|null $owner
ide-helper generates
|null
for similar relations. (eg.BelongsTo
)I tested this with nullable columns for
owner_id
andowner_type
, this does not make a difference.