Skip to content

Commit 0c2aa82

Browse files
committed
New attempt to fix bugsnag
1 parent eef5c60 commit 0c2aa82

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

app/Exceptions/Handler.php

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
11
<?php
22
namespace Lio\Exceptions;
33

4+
use Auth;
45
use Bugsnag;
56
use Exception;
6-
use Illuminate\Contracts\Auth\Guard;
77
use Symfony\Component\HttpKernel\Exception\HttpException;
88
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
99

1010
class Handler extends ExceptionHandler
1111
{
12-
/**
13-
* @var \Illuminate\Contracts\Auth\Guard
14-
*/
15-
private $auth;
16-
17-
/**
18-
* @param \Illuminate\Contracts\Auth\Guard $auth
19-
*/
20-
public function __construct(Guard $auth)
21-
{
22-
$this->auth = $auth;
23-
}
24-
2512
/**
2613
* A list of the exception types that should not be reported.
2714
*
@@ -42,10 +29,10 @@ public function __construct(Guard $auth)
4229
public function report(Exception $e)
4330
{
4431
// If a user is logged in, we'll set him as the target user for which the errors will occur.
45-
if ($this->auth->check()) {
32+
if (Auth::check()) {
4633
Bugsnag::setUser([
47-
'name' => $this->auth->user()->name,
48-
'email' => $this->auth->user()->email,
34+
'name' => Auth::user()->name,
35+
'email' => Auth::user()->email,
4936
]);
5037
}
5138

0 commit comments

Comments
 (0)