2024-05-23 15:20:21 +05:30
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Admin;
|
2024-06-18 13:00:42 +05:30
|
|
|
|
2024-05-27 12:10:55 +05:30
|
|
|
use App\Models\Termsandconditions;
|
|
|
|
|
use App\Services\Admin\termsandconditionServices;
|
2024-05-23 15:20:21 +05:30
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
|
use Illuminate\Http\Request;
|
2024-05-27 12:10:55 +05:30
|
|
|
use Illuminate\Validation\Rule;
|
|
|
|
|
use Validator;
|
2024-05-23 15:20:21 +05:30
|
|
|
|
|
|
|
|
class TermsController extends Controller
|
|
|
|
|
{
|
2024-06-18 13:00:42 +05:30
|
|
|
public function index()
|
|
|
|
|
{
|
2024-05-27 12:10:55 +05:30
|
|
|
$terms_condition = Termsandconditions::all()->toArray();
|
|
|
|
|
|
2024-06-18 13:00:42 +05:30
|
|
|
return view('Admin.pages.manage_cms.manage_terms.manage_terms', compact('terms_condition'));
|
2024-05-27 12:10:55 +05:30
|
|
|
}
|
|
|
|
|
// public function edit($id)
|
|
|
|
|
// {
|
|
|
|
|
// $terms = Termsandconditions::find($id)->toArray();
|
|
|
|
|
// return view('Admin.pages.manage_cms.manage_terms.manage_terms_edit', compact('terms'));
|
|
|
|
|
// }
|
|
|
|
|
public function edit($id)
|
2024-06-18 13:00:42 +05:30
|
|
|
{
|
|
|
|
|
|
|
|
|
|
$terms = Termsandconditions::find($id);
|
2024-05-27 12:10:55 +05:30
|
|
|
// dd($terms);
|
|
|
|
|
return view('Admin.pages.manage_cms.manage_terms.manage_terms_edit', compact('terms'));
|
2024-06-18 13:00:42 +05:30
|
|
|
}
|
2024-05-23 15:20:21 +05:30
|
|
|
|
2024-05-27 12:10:55 +05:30
|
|
|
public function update(Request $request)
|
|
|
|
|
{
|
2024-06-18 13:00:42 +05:30
|
|
|
|
2024-05-27 12:10:55 +05:30
|
|
|
$validated = $request->validate([
|
2024-06-18 13:00:42 +05:30
|
|
|
|
2024-05-27 12:10:55 +05:30
|
|
|
'article_des' => 'required', // Add validation for article_des
|
|
|
|
|
]);
|
|
|
|
|
$update = Termsandconditions::find($request->custom_id);
|
|
|
|
|
$update->message = $request->input('article_des');
|
|
|
|
|
$update->save();
|
|
|
|
|
return response()->json(['success' => true, 'status' => 200]);
|
2024-05-23 15:20:21 +05:30
|
|
|
}
|
2024-06-18 13:00:42 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
public function editTerms_rest($id)
|
|
|
|
|
{
|
|
|
|
|
$edit_terms_rest = Termsandconditions::find($id);
|
|
|
|
|
// return $edit_terms_rest;
|
|
|
|
|
return view('Admin.pages.manage_cms.manage_terms.manage_terns_edit_rest', compact('edit_terms_rest'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function update_rest(Request $request)
|
|
|
|
|
{
|
|
|
|
|
$validated = $request->validate([
|
|
|
|
|
'termsrest_des' => 'required',
|
|
|
|
|
]);
|
|
|
|
|
$update_rest = Termsandconditions::find($request->termRest_id);
|
|
|
|
|
$update_rest->message = $request->input('termsrest_des');
|
|
|
|
|
$update_rest->save();
|
|
|
|
|
return response()->json(['success' => true, 'status' => 200]);
|
|
|
|
|
}
|
2024-05-23 15:20:21 +05:30
|
|
|
}
|