Skip to content

Commit

Permalink
fix blade render with cache clean option
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 committed Oct 5, 2023
1 parent 27b088a commit ab9fad3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/DebugbarViewEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ public function __construct(Engine $engine, LaravelDebugbar $laravelDebugbar)
*/
public function get($path, array $data = [])
{
$shortPath = ltrim(str_replace(base_path(), '', realpath($path)), '/');
$basePath = base_path();
$shortPath = @file_exists((string) $path) ? realpath($path) : $path;

if (strpos($shortPath, $basePath) === 0) {
$shortPath = substr($shortPath, strlen($basePath));
}

$shortPath = ltrim(str_replace('\\', '/', $shortPath), '/');

return $this->laravelDebugbar->measure($shortPath, function () use ($path, $data) {
return $this->engine->get($path, $data);
Expand Down

0 comments on commit ab9fad3

Please sign in to comment.