feat: required envs

This commit is contained in:
Andras Bacsai
2024-10-11 14:38:22 +02:00
parent ca2d946064
commit 88f1e58c63
9 changed files with 214 additions and 128 deletions

View File

@@ -37,7 +37,14 @@
<h3>Production Environment Variables</h3>
<div>Environment (secrets) variables for Production.</div>
</div>
@forelse ($resource->environment_variables as $env)
@php
$requiredEmptyVars = $resource->environment_variables->filter(function($env) {
return $env->is_required && empty($env->value);
});
$otherVars = $resource->environment_variables->diff($requiredEmptyVars);
@endphp
@forelse ($requiredEmptyVars->merge($otherVars) as $env)
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
:env="$env" :type="$resource->type()" />
@empty