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()
|
|
|
|
{
|
2024-05-22 07:23:17 +00:00
|
|
|
$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');
|
|
|
|
}
|
|
|
|
}
|