File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 33use Backpack \Basset \Facades \Basset ;
44use Creativeorange \Gravatar \Facades \Gravatar ;
55use Illuminate \Support \Facades \Log ;
6+ use Illuminate \Support \Str ;
67
78if (! function_exists ('backpack_url ' )) {
89 /**
@@ -256,7 +257,22 @@ function backpack_view($view)
256257 }
257258 }
258259
259- dd ('Could not find Backpack view [ ' .$ view .'] in theme namespace, fallback namespace nor UI namespace. ' );
260+ $ errorMessage = 'The view: [ ' .$ view .'] was not found in any of the following view paths: [ ' .implode (' ], [ ' , $ viewPaths ).'] ' ;
261+
262+ $ errorDetails = (function () {
263+ if (env ('APP_ENV ' ) === 'production ' || ! env ('APP_DEBUG ' )) {
264+ return '' ;
265+ }
266+
267+ $ backtrace = debug_backtrace (DEBUG_BACKTRACE_IGNORE_ARGS , 2 ) ?? [];
268+ $ functionCaller = $ backtrace [1 ] ?? [];
269+ $ functionLine = $ functionCaller ['line ' ] ?? 'N/A ' ;
270+ $ functionFile = $ functionCaller ['file ' ] ?? 'N/A ' ;
271+
272+ return '- Called in: ' .Str::after ($ functionFile , base_path ()).' on line: ' .$ functionLine ;
273+ })();
274+
275+ abort (500 , $ errorMessage .$ errorDetails );
260276 }
261277}
262278
You can’t perform that action at this time.
0 commit comments