Skip to content

Commit e32e130

Browse files
authored
Telescope compatibility (barryvdh#883)
* Update BaseController.php * Set telescope to default except
1 parent 706192d commit e32e130

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

config/debugbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
'enabled' => env('DEBUGBAR_ENABLED', null),
1818
'except' => [
19-
//
19+
'telescope*'
2020
],
2121

2222
/*

src/Controllers/BaseController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use Barryvdh\Debugbar\LaravelDebugbar;
44
use Illuminate\Routing\Controller;
55
use Illuminate\Http\Request;
6+
use Laravel\Telescope\Telescope;
67

78
if (class_exists('Illuminate\Routing\Controller')) {
89

@@ -17,6 +18,13 @@ public function __construct(Request $request, LaravelDebugbar $debugbar)
1718
if ($request->hasSession()){
1819
$request->session()->reflash();
1920
}
21+
22+
$this->middleware(function ($request, $next) {
23+
if (class_exists(Telescope::class)) {
24+
Telescope::stopRecording();
25+
}
26+
return $next($request);
27+
});
2028
}
2129
}
2230

0 commit comments

Comments
 (0)