Skip to content

Commit 6727dad

Browse files
authored
Fix LaravelDebugbar imports (#1533)
* Fix LaravelDebugbar imports * Barryvdh AuthCollector does not exist
1 parent 640dc97 commit 6727dad

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/LaravelDebugbar.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22

33
namespace Barryvdh\Debugbar;
44

5-
use Barryvdh\Debugbar\DataCollector\AuthCollector;
65
use Barryvdh\Debugbar\DataCollector\CacheCollector;
76
use Barryvdh\Debugbar\DataCollector\EventCollector;
87
use Barryvdh\Debugbar\DataCollector\FilesCollector;
98
use Barryvdh\Debugbar\DataCollector\GateCollector;
109
use Barryvdh\Debugbar\DataCollector\LaravelCollector;
10+
use Barryvdh\Debugbar\DataCollector\LivewireCollector;
1111
use Barryvdh\Debugbar\DataCollector\LogsCollector;
1212
use Barryvdh\Debugbar\DataCollector\MultiAuthCollector;
1313
use Barryvdh\Debugbar\DataCollector\QueryCollector;
1414
use Barryvdh\Debugbar\DataCollector\SessionCollector;
1515
use Barryvdh\Debugbar\DataCollector\RequestCollector;
16+
use Barryvdh\Debugbar\DataCollector\RouteCollector;
1617
use Barryvdh\Debugbar\DataCollector\ViewCollector;
18+
use Barryvdh\Debugbar\DataFormatter\QueryFormatter;
1719
use Barryvdh\Debugbar\Storage\SocketStorage;
1820
use Barryvdh\Debugbar\Storage\FilesystemStorage;
21+
use Barryvdh\Debugbar\Support\Clockwork\ClockworkCollector;
1922
use DebugBar\Bridge\MonologCollector;
2023
use DebugBar\Bridge\Symfony\SymfonyMailCollector;
2124
use DebugBar\DataCollector\ConfigCollector;
@@ -27,13 +30,10 @@
2730
use DebugBar\DataCollector\PhpInfoCollector;
2831
use DebugBar\DataCollector\RequestDataCollector;
2932
use DebugBar\DataCollector\TimeDataCollector;
30-
use Barryvdh\Debugbar\DataFormatter\QueryFormatter;
31-
use Barryvdh\Debugbar\Support\Clockwork\ClockworkCollector;
3233
use DebugBar\DebugBar;
3334
use DebugBar\Storage\PdoStorage;
3435
use DebugBar\Storage\RedisStorage;
3536
use Exception;
36-
use Throwable;
3737
use Illuminate\Contracts\Foundation\Application;
3838
use Illuminate\Mail\Events\MessageSent;
3939
use Illuminate\Session\SessionManager;
@@ -44,6 +44,7 @@
4444
use Symfony\Component\Mailer\SentMessage;
4545
use Symfony\Component\Mailer\Transport\AbstractTransport;
4646
use Symfony\Component\Mime\RawMessage;
47+
use Throwable;
4748

4849
/**
4950
* Debug bar subclass which adds all without Request and with LaravelCollector.
@@ -249,7 +250,7 @@ function ($event, $params) {
249250

250251
if (!$this->isLumen() && $this->shouldCollect('route')) {
251252
try {
252-
$this->addCollector($this->app->make('Barryvdh\Debugbar\DataCollector\RouteCollector'));
253+
$this->addCollector($app->make(RouteCollector::class));
253254
} catch (Exception $e) {
254255
$this->addCollectorException('Cannot add RouteCollector', $e);
255256
}
@@ -427,10 +428,9 @@ function (\Illuminate\Database\Events\ConnectionEstablished $event) use ($queryC
427428
}
428429
}
429430

430-
if ($this->shouldCollect('livewire', true) && $this->app->bound('livewire')) {
431+
if ($this->shouldCollect('livewire', true) && $app->bound('livewire')) {
431432
try {
432-
$livewireCollector = $this->app->make('Barryvdh\Debugbar\DataCollector\LivewireCollector');
433-
$this->addCollector($livewireCollector);
433+
$this->addCollector($app->make(LivewireCollector::class));
434434
} catch (Exception $e) {
435435
$this->addCollectorException('Cannot add Livewire Collector', $e);
436436
}
@@ -511,8 +511,7 @@ public function __toString(): string
511511

512512
if ($this->shouldCollect('gate', false)) {
513513
try {
514-
$gateCollector = $this->app->make('Barryvdh\Debugbar\DataCollector\GateCollector');
515-
$this->addCollector($gateCollector);
514+
$this->addCollector($app->make(GateCollector::class));
516515
} catch (Exception $e) {
517516
$this->addCollectorException('Cannot add GateCollector', $e);
518517
}

0 commit comments

Comments
 (0)