belongsTo(FilamentCompanies::companyModel(), 'company_id'); } public function createdBy(): BelongsTo { return $this->belongsTo(FilamentCompanies::userModel(), 'created_by'); } public function document(): BelongsTo { return $this->belongsTo(Document::class); } public function scopeInvoice($query) { return $query->where('type', 'invoice'); } public function scopeBill($query) { return $query->where('type', 'bill'); } protected static function newFactory(): Factory { return DocumentTotalFactory::new(); } }