user()->companies; $data['current_company'] = $companies->first(function ($company){ return $company->id == $this->getCurrentCompanyId(); }); $data['companies'] = $companies->reject(function ($company){ return $company->id == $this->getCurrentCompanyId(); }); return $data; } }