Skip to content

Commit 0b28b72

Browse files
authored
Allow custom path for Inertia views (#1797)
1 parent 51308c7 commit 0b28b72

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

config/debugbar.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,10 @@
242242
'show_body' => env('DEBUGBAR_OPTIONS_MAIL_SHOW_BODY', true),
243243
],
244244
'views' => [
245-
'timeline' => env('DEBUGBAR_OPTIONS_VIEWS_TIMELINE', true), // Add the views to the timeline
246-
'data' => env('DEBUGBAR_OPTIONS_VIEWS_DATA', false), // True for all data, 'keys' for only names, false for no parameters.
247-
'group' => (int) env('DEBUGBAR_OPTIONS_VIEWS_GROUP', 50), // Group duplicate views. Pass value to auto-group, or true/false to force
245+
'timeline' => env('DEBUGBAR_OPTIONS_VIEWS_TIMELINE', true), // Add the views to the timeline
246+
'data' => env('DEBUGBAR_OPTIONS_VIEWS_DATA', false), // True for all data, 'keys' for only names, false for no parameters.
247+
'group' => (int) env('DEBUGBAR_OPTIONS_VIEWS_GROUP', 50), // Group duplicate views. Pass value to auto-group, or true/false to force
248+
'inertia_pages' => env('DEBUGBAR_OPTIONS_VIEWS_INERTIA_PAGES', 'js/Pages'), // Path for Inertia views
248249
'exclude_paths' => [ // Add the paths which you don't want to appear in the views
249250
'vendor/filament' // Exclude Filament components by default
250251
],

src/DataCollector/ViewCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private function getInertiaView(string $name, array $data, ?string $path)
125125
$name = $data['component'];
126126
$data = $data['props'];
127127

128-
if ($files = glob(resource_path('js/Pages/' . $name . '.*'))) {
128+
if ($files = glob(resource_path(config('debugbar.options.views.inertia_pages') .'/'. $name . '.*'))) {
129129
$path = $files[0];
130130
$type = pathinfo($path, PATHINFO_EXTENSION);
131131

0 commit comments

Comments
 (0)