mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Replace log.
This commit is contained in:
@@ -32,8 +32,16 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
|
||||
/**
|
||||
* @property User $user
|
||||
* @property UserGroup $userGroup
|
||||
* @property Collection<TransactionJournal> $transactionJournals
|
||||
*/
|
||||
#[ObservedBy([TransactionGroupObserver::class])]
|
||||
class TransactionGroup extends Model
|
||||
{
|
||||
@@ -50,13 +58,13 @@ class TransactionGroup extends Model
|
||||
*/
|
||||
public static function routeBinder(string $value): self
|
||||
{
|
||||
app('log')->debug(sprintf('Now in %s("%s")', __METHOD__, $value));
|
||||
Log::debug(sprintf('Now in %s("%s")', __METHOD__, $value));
|
||||
if (auth()->check()) {
|
||||
$groupId = (int)$value;
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
app('log')->debug(sprintf('User authenticated as %s', $user->email));
|
||||
Log::debug(sprintf('User authenticated as %s', $user->email));
|
||||
|
||||
/** @var null|TransactionGroup $group */
|
||||
$group = $user->transactionGroups()
|
||||
@@ -64,12 +72,12 @@ class TransactionGroup extends Model
|
||||
->where('transaction_groups.id', $groupId)->first(['transaction_groups.*'])
|
||||
;
|
||||
if (null !== $group) {
|
||||
app('log')->debug(sprintf('Found group #%d.', $group->id));
|
||||
Log::debug(sprintf('Found group #%d.', $group->id));
|
||||
|
||||
return $group;
|
||||
}
|
||||
}
|
||||
app('log')->debug('Found no group.');
|
||||
Log::debug('Found no group.');
|
||||
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
Reference in New Issue
Block a user