Skip to content

Commit

Permalink
Check path in ViewCollector (barryvdh#1424)
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Jul 3, 2023
1 parent bdfe99c commit 8ac7c19
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/DataCollector/ViewCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,17 @@ public function addView(View $view)
{
$name = $view->getName();
$path = $view->getPath();
$type = '';

if (!is_object($path)) {
if ($path) {
$path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
}
if ($path && is_string($path)) {
$path = ltrim(str_replace(base_path(), '', realpath($path)), '/');

if (substr($path, -10) == '.blade.php') {
$type = 'blade';
} else {
$type = pathinfo($path, PATHINFO_EXTENSION);
}
} else {
} elseif (is_object($path)) {
$type = get_class($view);
$path = '';
}
Expand Down

0 comments on commit 8ac7c19

Please sign in to comment.