Make hasOne / hasOneThrough and morphOne nullable. (#864)

This commit is contained in:
leo108
2020-03-31 14:40:50 +02:00
committed by GitHub
parent 1d1484025c
commit 18588eacf3
3 changed files with 29 additions and 8 deletions
@@ -26,6 +26,11 @@ class Simple extends Model
return $this->hasOne(Simple::class);
}
public function relationHasOneWithDefault(): HasOne
{
return $this->hasOne(Simple::class)->withDefault();
}
public function relationBelongsTo(): BelongsTo
{
return $this->belongsTo(Simple::class);