public static function fetch($name, $data = [], $paths = [])
    {
        if (empty($paths)) {
            $paths = config('view.path');
            if (empty($paths)) {
                $paths = [appPath('Views')];
            }
        }

        $view = new static($paths);

        //Check if it's blade
        $bladeFile = $view->getFilePath($name, '.blade.php');
        if ($bladeFile) {
            return $view->readBladeFile($name, $data);
        } else {
            //else, read file old school way
            $file = $view->getFilePath($name);
            return $view->getContent($file, $data);
        }
    }
public static function fetch($name, $data = [], $paths = [])
    {
        if (empty($paths)) {
            $paths = config('view.path');
            if (empty($paths)) {
                $paths = [appPath('Views')];
            }
        }

        $view = new static($paths);

        //Check if it's blade
        $bladeFile = $view->getFilePath($name, '.blade.php');
        if ($bladeFile) {
            return $view->readBladeFile($name, $data);
        } else {
            //else, read file old school way
            $file = $view->getFilePath($name);
            return $view->getContent($file, $data);
        }
    }
public static function fetch ( $ name , $ data = [ ] , $ paths = [ ] ) { if ( empty ( $ paths ) ) { $ paths = config ( 'view.path' ) ; if ( empty ( $ paths ) ) { $ paths = [ appPath ( 'Views' ) ] ; } } $ view = new static ( $ paths ) ; //Check if it's blade $ bladeFile = $ view -> getFilePath ( $ name , '.blade.php' ) ; if ( $ bladeFile ) { return $ view -> readBladeFile ( $ name , $ data ) ; } else { //else, read file old school way $ file = $ view -> getFilePath ( $ name ) ; return $ view -> getContent ( $ file , $ data ) ; } }
Fetch content of a view
@param string $name The view file name relative to the view path(s). Dot (.) or (/) can be use as directory separator
@param array $data Data to be passed to view
@param array $paths Paths to find view files
@return string
Fetch content of a view