diff --git a/app/Http/ValidationRules/Project/ValidProjectForClient.php b/app/Http/ValidationRules/Project/ValidProjectForClient.php index a23e421de398..e33d5366a2bd 100644 --- a/app/Http/ValidationRules/Project/ValidProjectForClient.php +++ b/app/Http/ValidationRules/Project/ValidProjectForClient.php @@ -35,6 +35,9 @@ class ValidProjectForClient implements Rule */ public function passes($attribute, $value) { + if(empty($this->input['project_id'])) + return true; + if(is_string($this->input['project_id'])) $this->input['project_id'] = $this->decodePrimaryKey($this->input['project_id']); diff --git a/app/Models/Presenters/CompanyPresenter.php b/app/Models/Presenters/CompanyPresenter.php index aac2ff141ce7..dfe272e13518 100644 --- a/app/Models/Presenters/CompanyPresenter.php +++ b/app/Models/Presenters/CompanyPresenter.php @@ -76,7 +76,7 @@ class CompanyPresenter extends EntityPresenter $settings = $this->entity->settings; } - $country = Country::find($settings->country_id)->first(); + $country = Country::find($settings->country_id); $swap = $country && $country->swap_postal_code; diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 42700c8a6b79..2075ace404bc 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -427,7 +427,7 @@ class HtmlEngine private function getCountryName() :string { - $country = Country::find($this->settings->country_id)->first(); + $country = Country::find($this->settings->country_id); if ($country) { return $country->name;