coolify/app/Livewire/Dev/Compose.php

38 lines
701 B
PHP
Raw Normal View History

2023-10-04 14:40:33 +02:00
<?php
2023-12-07 19:06:32 +01:00
namespace App\Livewire\Dev;
2023-10-04 14:40:33 +02:00
use Livewire\Component;
class Compose extends Component
{
public string $compose = '';
2024-06-10 22:43:34 +02:00
2023-10-04 14:40:33 +02:00
public string $base64 = '';
2024-06-10 22:43:34 +02:00
2023-10-04 14:40:33 +02:00
public $services;
2024-06-10 22:43:34 +02:00
public function mount()
{
$this->services = get_service_templates();
2023-10-04 14:40:33 +02:00
}
2024-06-10 22:43:34 +02:00
public function setService(string $selected)
{
$this->base64 = data_get($this->services, $selected.'.compose');
2023-10-04 14:40:33 +02:00
if ($this->base64) {
$this->compose = base64_decode($this->base64);
}
}
2024-06-10 22:43:34 +02:00
public function updatedCompose($value)
{
2023-10-04 14:40:33 +02:00
$this->base64 = base64_encode($value);
}
2024-06-10 22:43:34 +02:00
2023-10-04 14:40:33 +02:00
public function render()
{
return view('livewire.dev.compose');
}
}