49 lines
1.4 KiB
PHP
49 lines
1.4 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Controllers\Admin;
|
||
|
|
|
||
|
|
use App\Http\Controllers\Controller;
|
||
|
|
use App\Services\Admin\ManageAboutUsService;
|
||
|
|
use Illuminate\Http\Request;
|
||
|
|
|
||
|
|
class AboutUsController extends Controller
|
||
|
|
{
|
||
|
|
public function __construct(ManageAboutUsService $manageAboutUsService)
|
||
|
|
{
|
||
|
|
$this->manageAboutUsService = $manageAboutUsService;
|
||
|
|
}
|
||
|
|
|
||
|
|
public function view_about_us(){
|
||
|
|
|
||
|
|
$about_us['about_us'] = $this->manageAboutUsService->view_about_us()->toArray();
|
||
|
|
// echo "<pre>";
|
||
|
|
// print_r($about_us);
|
||
|
|
// echo "</pre>";exit;
|
||
|
|
|
||
|
|
// dd($about_us);
|
||
|
|
return view('Admin.Pages.manage_cms.about_us.about_us',$about_us);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function edit_about_us($id)
|
||
|
|
{
|
||
|
|
$about_us['about_us'] = $this->manageAboutUsService->edit_about_us($id)->toArray();
|
||
|
|
// echo "<pre>";
|
||
|
|
// print_r($about_us);
|
||
|
|
// echo "</pre>";exit;
|
||
|
|
return view('Admin.Pages.manage_cms.about_us.edit_about_us',$about_us);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function update_about_us(Request $request)
|
||
|
|
{
|
||
|
|
$edit_about_us = $this->manageAboutUsService->update_about_us($request);
|
||
|
|
if(!empty($edit_about_us))
|
||
|
|
{
|
||
|
|
return response()->json(['success' => true , 'status' => 200]);
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
return response()->json(['success' => false , 'status' => 422]);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|