JournalEntryType::class, 'amount' => JournalEntryCast::class, ]; public function account(): BelongsTo { return $this->belongsTo(Account::class, 'account_id'); } public function transaction(): BelongsTo { return $this->belongsTo(Transaction::class, 'transaction_id'); } public function isUncategorized(): bool { return $this->account->isUncategorized(); } protected static function newFactory(): Factory { return JournalEntryFactory::new(); } public function newCollection(array $models = []): JournalEntryCollection { return new JournalEntryCollection($models); } }