resetErrorBag(); $this->plugin = $this->plugin->fresh(); $this->trmnlp_id = $this->plugin->trmnlp_id; $this->uuid = $this->plugin->uuid; $this->alias = $this->plugin->alias ?? false; $this->use_trmnl_liquid_renderer = $this->plugin->preferred_renderer === 'trmnl-liquid'; $this->configurationTemplateYaml = $this->plugin->getCustomFieldsEditorYaml(); } public function saveTrmnlpId(): void { abort_unless(auth()->user()->plugins->contains($this->plugin), 403); $this->validate([ 'trmnlp_id' => [ 'nullable', 'string', 'max:255', Rule::unique('plugins', 'trmnlp_id') ->where('user_id', auth()->id()) ->ignore($this->plugin->id), ], 'alias' => 'boolean', 'use_trmnl_liquid_renderer' => 'boolean', 'configurationTemplateYaml' => [ 'nullable', 'string', function (string $attribute, mixed $value, \Closure $fail): void { if ($value === '') { return; } try { $parsed = Yaml::parse($value); if (! is_array($parsed)) { $fail('The configuration must be valid YAML and evaluate to an object/array.'); return; } Plugin::validateCustomFieldsList($parsed); } catch (ParseException) { $fail('The configuration must be valid YAML.'); } catch (\Illuminate\Validation\ValidationException $e) { foreach ($e->errors() as $messages) { foreach ($messages as $message) { $fail($message); } } } }, ], ]); $configurationTemplate = Plugin::configurationTemplateFromCustomFieldsYaml( $this->configurationTemplateYaml, $this->plugin->configuration_template ); $this->plugin->update([ 'trmnlp_id' => empty($this->trmnlp_id) ? null : $this->trmnlp_id, 'alias' => $this->alias, 'preferred_renderer' => $this->use_trmnl_liquid_renderer ? 'trmnl-liquid' : null, 'configuration_template' => $configurationTemplate, ]); $this->dispatch('config-updated'); Flux::modal('trmnlp-settings')->close(); } public function getAliasUrlProperty(): string { return url("/api/display/{$this->uuid}/alias"); } }; ?>
Recipe Settings
{{-- --}} TRMNLP Recipe ID Recipe ID in the TRMNL Recipe Catalog. If set, it can be used with trmnlp. Enable an Alias URL for this recipe. Your server does not need to be exposed to the internet, but your device must be able to reach the URL. Docs @if(config('services.trmnl.liquid_enabled') && $plugin->markup_language === 'liquid') trmnl-liquid is a Ruby-based renderer that matches the Core service’s Liquid behavior for better compatibility. @endif Configuration template Build forms visually in the TRMNL YML Form Builder. Check the docs for more information. @php $configTemplateTextareaId = 'config-template-' . uniqid(); @endphp @if($alias) Alias URL Copy this URL to your TRMNL Dashboard. By default, image is created for TRMNL OG; use parameter ?device-model= to specify a device model. @endif
Cancel Save