lots of updates + refactoring

This commit is contained in:
Andras Bacsai
2023-08-07 22:14:21 +02:00
parent bfc20ef219
commit 971d7f703d
51 changed files with 532 additions and 324 deletions

View File

@@ -0,0 +1,48 @@
<?php
namespace App\Http\Livewire\Project\Shared\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',
];
protected $validationAttributes = [
'key' => 'key',
'value' => 'value',
'is_build_time' => 'build',
];
public function mount()
{
$this->parameters = getRouteParameters();
}
public function submit()
{
ray('submitting');
$this->validate();
$this->emitUp('submit', [
'key' => $this->key,
'value' => $this->value,
'is_build_time' => $this->is_build_time,
'is_preview' => $this->is_preview,
]);
$this->clear();
}
public function clear()
{
$this->key = '';
$this->value = '';
$this->is_build_time = false;
}
}