middleware(['maintenance_mode','admin']); $this->footerService = $footerService; $this->dynamicPageService = $dynamicPageService; $this->widgetService = $widgetService; } public function index() { try { $FooterContent = $this->footerService->getAll(); $dynamicPageList = $this->dynamicPageService->getActiveAll(); $SectionOnePages = $this->widgetService->getAllCompany(); $SectionTwoPages = $this->widgetService->getAllAccount(); $SectionThreePages = $this->widgetService->getAllService(); $footer_content_new = $this->footerService->getFooterContent(); return view('footersetting::footer.index', compact('FooterContent', 'dynamicPageList', 'SectionOnePages', 'SectionTwoPages', 'SectionThreePages','footer_content_new')); } catch (Exception $e) { LogActivity::errorLog($e->getMessage()); return $e->getMessage(); } } public function widgetStore(FooterWidgetRequest $request) { try { $this->widgetService->save($request->except('_token')); $notification = array( 'messege' => __('common.created_successfully'), 'alert-type' => 'success' ); LogActivity::successLog('Widget added.'); return redirect()->back()->with($notification); } catch (Exception $e) { LogActivity::errorLog($e->getMessage()); return $e->getMessage(); } } public function widgetStatus(Request $request) { try { $data = [ 'status' => $request->status == 1 ? 0 : 1 ]; LogActivity::successLog('Widget status changed.'); return $this->widgetService->statusUpdate($data, $request->id); } catch (Exception $e) { LogActivity::errorLog($e->getMessage()); return $e->getMessage(); } } public function show($id) { return view('footersetting::show'); } public function widgetUpdate(FooterWidgetRequest $request) { try { $this->widgetService->update($request->except('_token'), $request->id); Toastr::success(__('common.updated_successfully'),__('common.success')); LogActivity::successLog('Widget updated.'); return redirect()->route('footerSetting.footer.index'); } catch (Exception $e) { LogActivity::errorLog($e->getMessage()); return $e->getMessage(); } } public function contentUpdate(Request $request) { try { $update = $this->footerService->update($request->except('_token'), $request->id); LogActivity::successLog('footer Content updated.'); return $update; } catch (Exception $e) { LogActivity::errorLog($e->getMessage()); return $e->getMessage(); } } public function contentAppUpdate(Request $request) { try { $update = $this->footerService->updateAppLink($request->except('_token')); LogActivity::successLog('footer Content updated.'); return $update; } catch (Exception $e) { LogActivity::errorLog($e->getMessage()); return $e->getMessage(); } } public function destroy($id) { try { $this->widgetService->delete($id); Toastr::success(__('common.deleted_successfully')); LogActivity::successLog('Widget deleted.'); return redirect()->route('footerSetting.footer.index'); } catch (Exception $e) { LogActivity::errorLog($e->getMessage()); return $e->getMessage(); } } public function tabSelect($id){ Session::put('footer_tab',$id); return 'done'; } }