isLoading = true; $this->validate([ 'blade_code' => 'required|string' ]); try { $rendered = Blade::render($this->blade_code); // if (config('app.puppeteer_docker')) { // GenerateScreenJob::dispatch(auth()->user()->devices()->first()->id, $rendered); // } else { GenerateScreenJob::dispatchSync(auth()->user()->devices()->first()->id, $rendered); // } } catch (\Exception $e) { $this->addError('error', $e->getMessage()); } $this->isLoading = false; } public function renderExample(string $example) { switch ($example) { case 'quote': $markup = $this->renderQuote(); break; case 'trainMonitor': $markup = $this->renderTrainMonitor(); break; case 'homeAssistant': $markup = $this->renderHomeAssistant(); break; default: $markup = '

Hello World!

'; break; } $this->blade_code = $markup; } public function renderQuote(): string { return << Motivational Quote “I love inside jokes. I hope to be a part of one someday.” Michael Scott HTML; } public function renderTrainMonitor() { return << Abfahrt Aktuell Zug Ziel Steig 08:51 08:52 REX 1 Vienna Main Station 3 HTML; } public function renderHomeAssistant() { return << 23.3° 47.52 % Sensor 1 HTML; } }; ?>

Markup

{{--
--}}
Generate Screen
{{--
--}}