Minor code cleanup.

This commit is contained in:
James Cole
2021-08-28 15:47:09 +02:00
parent 92f7a9c574
commit a14c9438ad
34 changed files with 321 additions and 293 deletions

View File

@@ -96,13 +96,13 @@ class Category extends Model
*
* @param string $value
*
* @throws NotFoundHttpException
* @return Category
* @throws NotFoundHttpException
*/
public static function routeBinder(string $value): Category
{
if (auth()->check()) {
$categoryId = (int) $value;
$categoryId = (int)$value;
/** @var User $user */
$user = auth()->user();
/** @var Category $category */
@@ -114,14 +114,6 @@ class Category extends Model
throw new NotFoundHttpException;
}
/**
* @codeCoverageIgnore
* @return BelongsToMany
*/
public function transactionJournals(): BelongsToMany
{
return $this->belongsToMany(TransactionJournal::class, 'category_transaction_journal', 'category_id');
}
/**
* @codeCoverageIgnore
* @return MorphMany
@@ -140,6 +132,15 @@ class Category extends Model
return $this->morphMany(Note::class, 'noteable');
}
/**
* @codeCoverageIgnore
* @return BelongsToMany
*/
public function transactionJournals(): BelongsToMany
{
return $this->belongsToMany(TransactionJournal::class, 'category_transaction_journal', 'category_id');
}
/**
* @codeCoverageIgnore
* @return BelongsToMany