content = $content; } public function privacyData() { return view('Admin.Pages.manage_cms.manage_Privacy_policy.privacy', [ 'data' => $this->content->privacyPolicy() ]); } public function privacyEdit($type) { return view('Admin.Pages.manage_cms.manage_Privacy_policy.edit_privacy_policy', [ 'data' => $this->content->privacyPolicy() ]); } public function privacyUpdate(UpdatePrivacyPolicyRequest $request) { $privacyPolicyUpdated = $this->content->updatePrivacy($request); return $privacyPolicyUpdated ? $this->response('Privacy Policy Updated', 200) : $this->response('Could Not Update Privacy Policy', 400); } public function privacyPolicyApi() { try { return (new PrivacyResource(Content::where('type', 'privacy-policy')->first())) ->response() ->setStatusCode(200); } catch (\Exception $e) { return response()->json(['message' => $e->getMessage()], 400); } } //====================================================Terms and Controller===================================================================// public function termsData() { return view('Admin.Pages.manage_cms.manage_Privacy_policy.privacy', [ 'data' => $this->content->termsCondition() ]); } public function termsEdit() { return view('Admin.Pages.manage_cms.manage_Privacy_policy.edit_privacy_policy', [ 'data' => $this->content->termsCondition() ]); } public function termsUpdate(UpdateTermsAndConditionsRequest $request) { $termsAndConditionsUpdated = $this->content->updateTerms($request); return $termsAndConditionsUpdated ? $this->response('Terms and Conditions Updated', 200) : $this->response('Could Not Update Terms and Conditions', 400); } public function termsConditionApi() { try { return (new TermsConditionResource(Content::where('type', 'terms-and-condition')->first())) ->response() ->setStatusCode(200); } catch (\Exception $e) { return response()->json(['message' => $e->getMessage()], 400); } } }