view->getFinder()->getHints(); if (isset($hints[$namespace])) { $path = $hints[$namespace][0] . '/' . $file; } else { $viewsPath = app()->view->getFinder()->getPaths()[0]; $path = $viewsPath . '/' . $file; } if (!is_file($path)) { throw new \Exception('File not found: ' . $path); } $content = file_get_contents($path); $compiled = Blade::render($content, $data); return $compiled; } }