mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 06:31:22 +00:00
Minor code cleanup.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user