lasthourcloud/app/Http/Livewire/Project/Application/EnvironmentVariable/Add.php
Andras Bacsai e5aad4d170 updates
2023-06-05 12:07:55 +02:00

42 lines
994 B
PHP

<?php
namespace App\Http\Livewire\Project\Application\EnvironmentVariable;
use Livewire\Component;
class Add extends Component
{
public $parameters;
public bool $is_preview = false;
public string $key;
public string $value;
public bool $is_build_time = false;
protected $listeners = ['clearAddEnv' => 'clear'];
protected $rules = [
'key' => 'required|string',
'value' => 'required|string',
'is_build_time' => 'required|boolean',
];
public function mount()
{
$this->parameters = get_parameters();
}
public function submit()
{
$this->validate();
$this->emitUp('submit', [
'key' => $this->key,
'value' => $this->value,
'is_build_time' => $this->is_build_time,
'is_preview' => $this->is_preview,
]);
}
public function clear()
{
$this->key = '';
$this->value = '';
$this->is_build_time = false;
}
}