@php $current_route = $request->route()->getName(); $approved_count = \App\Models\Target::where('status', 1) ->where('created_by', auth()->user()->id) ->count(); $pending_count = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ($query) { $query->where('document_type', 17); })->where(['created_by' => auth()->user()->id, 'status' => 0])->where('type','target_achievement')->count(); $reverted_count = \App\Models\WorkFlowApproval::whereHas('WorkFlow', function ($query) { $query->where('document_type', 17); })->where(['created_by' => auth()->user()->id, 'status' => 4])->where('type','target_achievement')->count(); @endphp