From 340620c841eee4ae4874e4a0dd5981960c04382e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Mon, 29 Jun 2020 23:28:57 +0300 Subject: [PATCH] formatting --- app/Models/Auth/User.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/Models/Auth/User.php b/app/Models/Auth/User.php index 759dc6367..be1268dcf 100644 --- a/app/Models/Auth/User.php +++ b/app/Models/Auth/User.php @@ -6,12 +6,11 @@ use App\Traits\Tenants; use App\Notifications\Auth\Reset; use App\Traits\Media; use Date; -use GuzzleHttp\Exception\RequestException; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; -use Laratrust\Traits\LaratrustUserTrait; use Kyslik\ColumnSortable\Sortable; +use Laratrust\Traits\LaratrustUserTrait; use Lorisleiva\LaravelSearchString\Concerns\SearchString; class User extends Authenticatable @@ -102,7 +101,7 @@ class User extends Authenticatable $client->request('GET', $url)->getBody()->getContents(); $value = $url; - } catch (RequestException $e) { + } catch (\GuzzleHttp\Exception\RequestException $e) { // 404 Not Found } } @@ -190,13 +189,7 @@ class User extends Authenticatable */ public function setCompanyIds() { - $company_ids = []; - - foreach ($this->companies as $company) { - $company_ids[] = (string) $company->id; - } - - $this->setAttribute('company_ids', $company_ids); + $this->setAttribute('company_ids', $this->companies->pluck('id')->toArray()); } public function unsetCompanyIds()