render('vendor_profile.edit', [ 'contact' => $vendor_contact, 'vendor' => $vendor_contact->vendor, 'settings' => $vendor_contact->vendor->company->settings, 'company' => $vendor_contact->vendor->company, 'sidebar' => $this->sidebarMenu(), 'countries' => app('countries'), ]); } public function update(Request $request, VendorContact $vendor_contact) { $vendor_contact->fill($request->all()); $vendor_contact->vendor->fill($request->all()); $vendor_contact->push(); return back()->withSuccess(ctrans('texts.profile_updated_successfully')); } private function sidebarMenu(): array { $enabled_modules = auth()->guard('vendor')->user()->company->enabled_modules; $data = []; if (self::MODULE_PURCHASE_ORDERS & $enabled_modules) { $data[] = ['title' => ctrans('texts.purchase_orders'), 'url' => 'vendor.purchase_orders.index', 'icon' => 'file-text']; } return $data; } }