From b371ac2773d23e32d0e740b477b0154a481bd509 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Tue, 20 Jun 2023 10:33:22 +0300 Subject: [PATCH] Add a getter for companies in City model. --- app/Models/City.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Models/City.php b/app/Models/City.php index acb6370..3e6f956 100644 --- a/app/Models/City.php +++ b/app/Models/City.php @@ -26,6 +26,11 @@ class City extends Model return $this->companies()->pluck('company_id')->toArray(); } + public function getCompanies() + { + return $this->companies; + } + public function addCompanyId(int $company_id) { $this->addCompanyIds([$company_id]);