first commit of ritikesh freeu

This commit is contained in:
Ritikesh yadav
2024-07-04 13:01:12 +05:30
parent c47edbce37
commit 52073a60fc
3 changed files with 19 additions and 16 deletions

View File

@@ -33,7 +33,7 @@ class HomeController extends Controller
// dd($this->getAllTopPickProducts()['data']->toArray());
return view('Frontend.Pages.index', [
'topPicks' => $this->getAllTopPickProducts(),
'testimonial' => Testimonial::where('is_active',true)->get(),
'testimonial' => Testimonial::where('is_active', true)->get(),
]);
}
@@ -43,15 +43,14 @@ class HomeController extends Controller
session()->forget('risk_disclosure');
$checkRiskDisclosure = $request->checked_risk_disclosure == 'true' ? Session::put('risk_disclosure', 'true') : Session::put('risk_disclosure', 'false');
// dd(Session::get('risk_disclosure'));
if(Session::get('risk_disclosure') == 'true')
{
return response()->json(['status'=>200]);
if (Session::get('risk_disclosure') == 'true') {
return response()->json(['status' => 200]);
}
}
public function getAllTopPickProducts()
{
$data['data'] = Product::getAllDetails()->where('top_pick',true)->where('products.status',1)->where('categories.status',true)->get();
$data['data'] = Product::getAllDetails()->where('top_pick', true)->where('products.status', 1)->where('categories.status', true)->get();
// dd($data['data']);
// foreach($data['data'] as $row)
// {
@@ -234,7 +233,7 @@ class HomeController extends Controller
{
$user = User::find($request->user()->id);
$count = $user->unreadNotifications->count();
return response()->json(['status'=>200,'count'=>$count]);
return response()->json(['status' => 200, 'count' => $count]);
}
public function getAllNotificationsApi(Request $request)