*/ use ErbtZuordnung, HasFactory; /** * @return array */ protected function casts(): array { return [ 'land' => Land::class, 'menge' => 'decimal:3', 'einheitspreis' => 'decimal:2', ]; } protected function zuordnungsEltern(): ?Model { return $this->nachtrag()->first(); } /** @return BelongsTo */ public function nachtrag(): BelongsTo { return $this->belongsTo(Nachtrag::class); } }