VendorType::class, 'contractor_type' => ContractorType::class, 'ssn' => 'encrypted', 'ein' => 'encrypted', ]; public function bills(): HasMany { return $this->hasMany(Document::class, 'vendor_id') ->where('type', DocumentType::Bill); } public function currency(): BelongsTo { return $this->belongsTo(Currency::class, 'currency_code', 'code'); } public function address(): MorphOne { return $this->morphOne(Address::class, 'addressable'); } public function contact(): MorphOne { return $this->morphOne(Contact::class, 'contactable'); } }