'required|string', 'value' => 'required|string', 'is_build_time' => 'required|boolean', ]; public function mount() { $this->parameters = Route::current()->parameters(); } public function submit() { $this->validate(); try { $application_id = Application::where('uuid', $this->parameters['application_uuid'])->firstOrFail()->id; EnvironmentVariable::create([ 'key' => $this->key, 'value' => $this->value, 'is_build_time' => $this->is_build_time, 'application_id' => $application_id, ]); $this->emit('refreshEnvs'); $this->key = ''; $this->value = ''; } catch (mixed $e) { dd('asdf'); if ($e instanceof QueryException) { dd($e->errorInfo); $this->emit('error', $e->errorInfo[2]); } else { $this->emit('error', $e); } } } }