mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
feat: plugins can define blade views to render
This commit is contained in:
parent
7d87b42817
commit
cda1223103
1 changed files with 5 additions and 1 deletions
|
|
@ -47,7 +47,11 @@ Route::get('/display', function (Request $request) {
|
|||
|
||||
if ($playlistItem) {
|
||||
$playlistItem->update(['last_displayed_at' => now()]);
|
||||
$markup = Blade::render($playlistItem->plugin->render_markup, ['data' => $playlistItem->plugin->data_payload]);
|
||||
if ($playlistItem->plugin->render_markup) {
|
||||
$markup = Blade::render($playlistItem->plugin->render_markup, ['data' => $playlistItem->plugin->data_payload]);
|
||||
} elseif ($playlistItem->plugin->render_markup_view) {
|
||||
$markup = view($playlistItem->plugin->render_markup_view, ['data' => $playlistItem->plugin->data_payload])->render();
|
||||
}
|
||||
|
||||
GenerateScreenJob::dispatchSync($device->id, $markup);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue