`var userID = $('#idUserLogin').val();
console.log(userID);
$.ajax({
url: `/report/getUserNotifId/${id}`,
method: "GET",
dataType: 'json',
success:function(response){
console.log(response);
}
});
<input type="hidden" id="idUserLogin" value="{{ auth()->user()->id }}">
public function getReportNotifByUserID($id)
{
$user = Report::where('pelapor', $id)->orWhere('status', 2)->get();
return response()->json($user);
}`
My Question :
- I want to display the count notification on the dashboard page.
- Want to display reports based on Count Users with Ajax.
- Is my code wrong? -Thank You