coolify/app/Http/Livewire/Project/Application/EnvironmentVariable/Show.php

33 lines
722 B
PHP
Raw Normal View History

2023-05-04 22:29:14 +02:00
<?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',
];
public function mount()
{
2023-05-24 14:26:50 +02:00
$this->parameters = get_parameters();
2023-05-04 22:29:14 +02:00
}
public function submit()
{
$this->validate();
$this->env->save();
}
public function delete()
{
$this->env->delete();
2023-05-05 09:28:00 +02:00
$this->emit('refreshEnvs');
2023-05-04 22:29:14 +02:00
}
}