lasthourcloud/app/Livewire/Dev/Compose.php

38 lines
701 B
PHP
Raw Normal View History

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