Laravel Query – Count and filter

  laravel, php

I have a problem with this query: I Want to count how many logs there are in the last 24h from a specific user, and with a specific status_code (example 400)".

Actually, with this query, I found all logs from a specific company.

  $webhookLog = WebhookLog::where('company_id', $company->id)
->orderBy('updated_at', 'desc')->get();

Source: Laravel

Leave a Reply