Skip to content

Commit 166ad8c

Browse files
Handle case where an external call was made from a view
1 parent 9a1b641 commit 166ad8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Views/ViewExceptionMapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ protected function modifyViewsInTrace(IgnitionViewException $exception): void
8383
{
8484
$viewIndex = null;
8585

86-
8786
$trace = Collection::make($exception->getPrevious()->getTrace())
8887
->map(function ($trace, $index) use (&$viewIndex) {
8988
if ($originalPath = $this->findCompiledView(Arr::get($trace, 'file', ''))) {
89+
9090
$trace['file'] = $originalPath;
9191
$trace['line'] = $this->getBladeLineNumber($trace['file'], $trace['line']);
9292

@@ -98,7 +98,7 @@ protected function modifyViewsInTrace(IgnitionViewException $exception): void
9898
return $trace;
9999
})
100100
->when(
101-
$viewIndex !== null,
101+
$viewIndex !== null && str_ends_with($exception->getFile(), '.blade.php'),
102102
fn (Collection $trace) => $trace->slice($viewIndex + 1) // Remove all traces before the view
103103
)
104104
->toArray();

0 commit comments

Comments
 (0)