Files
cheerstothe_season_2.0/app/Http/Controllers/Admin/PrivacyPolicyController.php

80 lines
2.3 KiB
PHP
Raw Normal View History

2024-05-23 15:20:21 +05:30
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
2024-05-27 12:10:55 +05:30
use App\Models\PrivacyPolicy;
2024-05-23 15:20:21 +05:30
class PrivacyPolicyController extends Controller
{
2024-06-05 20:10:10 +05:30
2024-05-27 12:10:55 +05:30
// public function index(){
// return view('Admin.pages.manage_cms.manage_privacy.manage_privacy');
// }
// public function index(){
// $view_privacy_policy = PrivacyPolicy::get()->toArray();
// // dd($view_privacy_policy);
// return view('Admin.pages.manage_cms.manage_privacy.manage_privacy');
// }
2024-05-23 15:20:21 +05:30
2024-06-05 20:10:10 +05:30
/**
* Created By : sayali parab
* Created at : 29 May 2024
* Use : To get privacy policy page.
*/
2024-05-27 12:10:55 +05:30
public function index(){
2024-05-28 12:45:23 +05:30
$view_privacy = PrivacyPolicy::get()->toArray();
return view('Admin.pages.manage_cms.manage_privacy.manage_privacy', compact('view_privacy'));
2024-05-23 15:20:21 +05:30
}
2024-05-28 12:45:23 +05:30
2024-06-05 20:10:10 +05:30
/**
* Created By : sayali parab
* Created at : 29 May 2024
* Use : To edit.
*/
2024-06-17 12:34:42 +05:30
public function edit($id)
{
2024-05-27 12:10:55 +05:30
$edit_privacy_policy = PrivacyPolicy::find($id)->toArray();
return view('Admin.pages.manage_cms.manage_privacy.manage_privacy_policy_edit', compact('edit_privacy_policy'));
}
2024-05-28 12:45:23 +05:30
2024-06-05 20:10:10 +05:30
/**
* Created By : sayali parab
* Created at : 29 May 2024
* Use : To update privacy policy page.
*/
2024-05-28 12:45:23 +05:30
public function update(Request $request)
{
$update = PrivacyPolicy::find($request->privacy_custom_id);
$update->description = $request->input('privacy_policy');
$update->save();
return response()->json(['success' => true, 'status' => 200]);
}
2024-06-05 20:10:10 +05:30
/**
* Created By : sayali parab
* Created at : 29 May 2024
* Use : To edit rest.
*/
2024-05-28 12:45:23 +05:30
public function edit_rest($id)
{
$edit_privacy_policy_rest = PrivacyPolicy::find($id)->toArray();
return view('Admin.pages.manage_cms.manage_privacy.manage_privacy_policy_edit_rest', compact('edit_privacy_policy_rest'));
}
2024-06-05 20:10:10 +05:30
/**
* Created By : sayali parab
* Created at : 30 May 2024
* Use : To update rest.
*/
2024-05-28 12:45:23 +05:30
public function update_rest(Request $request)
{
$update = PrivacyPolicy::find($request->privacy_rest_id);
$update->description = $request->input('edit_privacy_policy_rest');
$update->save();
return response()->json(['success' => true, 'status' => 200]);
}
2024-05-23 15:20:21 +05:30
}