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' => TranslationHelper::getCountries() ]); } public function update(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 = []; // TODO: Enable dashboard once it's completed. // $this->settings->enable_client_portal_dashboard // $data[] = [ 'title' => ctrans('texts.dashboard'), 'url' => 'client.dashboard', 'icon' => 'activity']; if (self::MODULE_PURCHASE_ORDERS & $enabled_modules) { $data[] = ['title' => ctrans('texts.purchase_orders'), 'url' => 'vendor.purchase_orders.index', 'icon' => 'file-text']; } // $data[] = ['title' => ctrans('texts.documents'), 'url' => 'client.documents.index', 'icon' => 'download']; return $data; } }