MMCT TEAM
Server IP : 103.191.208.50  /  Your IP : 216.73.216.53
Web Server : LiteSpeed
System : Linux orion.herosite.pro 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64
User : celkcksm ( 1031)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, popen, exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/celkcksm/hrms.ncriptech.com/vendor/barryvdh/laravel-debugbar/src/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/celkcksm/hrms.ncriptech.com/vendor/barryvdh/laravel-debugbar/src/DebugbarViewEngine.php
<?php

declare(strict_types=1);

namespace Barryvdh\Debugbar;

use Illuminate\Contracts\View\Engine;

class DebugbarViewEngine implements Engine
{
    /**
     * @var Engine
     */
    protected $engine;

    /**
     * @var LaravelDebugbar
     */
    protected $laravelDebugbar;

    /**
     * @var array
     */
    protected $exclude_paths;

    /**
     * @param  Engine  $engine
     * @param  LaravelDebugbar  $laravelDebugbar
     */
    public function __construct(Engine $engine, LaravelDebugbar $laravelDebugbar)
    {
        $this->engine = $engine;
        $this->laravelDebugbar = $laravelDebugbar;
        $this->exclude_paths = app('config')->get('debugbar.options.views.exclude_paths', []);
    }

    /**
     * @param  string  $path
     * @param  array  $data
     * @return string
     */
    public function get($path, array $data = [])
    {
        $basePath = base_path();
        $shortPath = @file_exists((string) $path) ? realpath($path) : $path;

        if (str_starts_with($shortPath, $basePath)) {
            $shortPath = ltrim(
                str_replace('\\', '/', substr($shortPath, strlen($basePath))),
                '/'
            );
        }

        foreach ($this->exclude_paths as $excludePath) {
            if (str_starts_with($shortPath, $excludePath)) {
                return $this->engine->get($path, $data);
            }
        }

        return $this->laravelDebugbar->measure($shortPath, function () use ($path, $data) {
            return $this->engine->get($path, $data);
        }, 'views');
    }

    /**
     * NOTE: This is done to support other Engine swap (example: Livewire).
     * @param $name
     * @param $arguments
     * @return mixed
     */
    public function __call($name, $arguments)
    {
        return $this->engine->$name(...$arguments);
    }
}

MMCT - 2023