@@ -4,7 +4,6 @@ namespace App\Livewire\Project\Shared\EnvironmentVariable;
|
||||
|
||||
use App\Models\EnvironmentVariable as ModelsEnvironmentVariable;
|
||||
use App\Models\SharedEnvironmentVariable;
|
||||
use Exception;
|
||||
use Livewire\Component;
|
||||
|
||||
class Show extends Component
|
||||
@@ -61,7 +60,7 @@ class Show extends Component
|
||||
public function mount()
|
||||
{
|
||||
$this->syncData();
|
||||
if ($this->env->getMorphClass() === SharedEnvironmentVariable::class) {
|
||||
if ($this->env->getMorphClass() === \App\Models\SharedEnvironmentVariable::class) {
|
||||
$this->isSharedVariable = true;
|
||||
}
|
||||
$this->parameters = get_route_parameters();
|
||||
@@ -117,7 +116,7 @@ class Show extends Component
|
||||
public function serialize()
|
||||
{
|
||||
data_forget($this->env, 'real_value');
|
||||
if ($this->env->getMorphClass() === SharedEnvironmentVariable::class) {
|
||||
if ($this->env->getMorphClass() === \App\Models\SharedEnvironmentVariable::class) {
|
||||
data_forget($this->env, 'is_build_time');
|
||||
}
|
||||
}
|
||||
@@ -157,7 +156,7 @@ class Show extends Component
|
||||
$this->value = $oldValue;
|
||||
$this->dispatch('error', 'Required environment variable cannot be empty.');
|
||||
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
$this->serialize();
|
||||
@@ -169,11 +168,9 @@ class Show extends Component
|
||||
$this->syncData(true);
|
||||
$this->dispatch('success', 'Environment variable updated.');
|
||||
$this->dispatch('envsUpdated');
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return handleError($e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function delete()
|
||||
@@ -182,10 +179,8 @@ class Show extends Component
|
||||
$this->env->delete();
|
||||
$this->dispatch('environmentVariableDeleted');
|
||||
$this->dispatch('success', 'Environment variable deleted successfully.');
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
return handleError($e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user