Add fileserver support

This commit is contained in:
Marcel Pociot
2020-11-01 17:43:42 +01:00
parent 880259657f
commit ce945e1326
9 changed files with 466 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ use Twig\Loader\ArrayLoader;
trait LoadsViews
{
protected function getView(ConnectionInterface $connection, string $view, array $data = [])
protected function getView(?ConnectionInterface $connection, string $view, array $data = [])
{
$templatePath = implode(DIRECTORY_SEPARATOR, explode('.', $view));
@@ -23,7 +23,10 @@ trait LoadsViews
$data = array_merge($data, [
'request' => $connection->laravelRequest ?? null,
]);
try {
return stream_for($twig->render('template', $data));
} catch (\Throwable $e) {
var_dump($e->getMessage());
}
}
}