lasthourcloud/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php
Andras Bacsai 3589b92ec9 fix
2023-06-16 12:35:40 +02:00

38 lines
861 B
PHP

<?php
namespace App\Http\Livewire\Project\Application\EnvironmentVariable;
use App\Models\EnvironmentVariable as ModelsEnvironmentVariable;
use Livewire\Component;
class Show extends Component
{
public $parameters;
public ModelsEnvironmentVariable $env;
protected $rules = [
'env.key' => 'required|string',
'env.value' => 'required|string',
'env.is_build_time' => 'required|boolean',
];
protected $validationAttributes = [
'key' => 'key',
'value' => 'value',
'is_build_time' => 'build',
];
public function mount()
{
$this->parameters = getRouteParameters();
}
public function submit()
{
$this->validate();
$this->env->save();
}
public function delete()
{
$this->env->delete();
$this->emit('refreshEnvs');
}
}