mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 09:51:40 +00:00
Remove static references
This commit is contained in:
@@ -96,22 +96,22 @@ class TransactionGroup extends Model
|
||||
*/
|
||||
public static function routeBinder(string $value): TransactionGroup
|
||||
{
|
||||
Log::debug(sprintf('Now in %s("%s")', __METHOD__, $value));
|
||||
app('log')->debug(sprintf('Now in %s("%s")', __METHOD__, $value));
|
||||
if (auth()->check()) {
|
||||
$groupId = (int)$value;
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
Log::debug(sprintf('User authenticated as %s', $user->email));
|
||||
app('log')->debug(sprintf('User authenticated as %s', $user->email));
|
||||
/** @var TransactionGroup $group */
|
||||
$group = $user->transactionGroups()
|
||||
->with(['transactionJournals', 'transactionJournals.transactions'])
|
||||
->where('transaction_groups.id', $groupId)->first(['transaction_groups.*']);
|
||||
if (null !== $group) {
|
||||
Log::debug(sprintf('Found group #%d.', $group->id));
|
||||
app('log')->debug(sprintf('Found group #%d.', $group->id));
|
||||
return $group;
|
||||
}
|
||||
}
|
||||
Log::debug('Found no group.');
|
||||
app('log')->debug('Found no group.');
|
||||
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
Reference in New Issue
Block a user