Add notes to category #4002

This commit is contained in:
James Cole
2020-10-28 06:32:37 +01:00
parent 3aa835a985
commit ca3d836c83
7 changed files with 92 additions and 9 deletions

View File

@@ -70,7 +70,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property-read int|null $attachments_count
* @property-read int|null $transaction_journals_count
* @property-read int|null $transactions_count
* @property bool $encrypted
*/
class Category extends Model
{
@@ -135,6 +134,15 @@ class Category extends Model
return $this->morphMany(Attachment::class, 'attachable');
}
/**
* @codeCoverageIgnore
* Get all of the category's notes.
*/
public function notes(): MorphMany
{
return $this->morphMany(Note::class, 'noteable');
}
/**
* @codeCoverageIgnore
* @return BelongsToMany