mercredi 14 juillet 2021

Count data from a column with today's date [duplicate]

I am counting the number of values in the column "asistencia", but I want you to count only those of today.

Database: https://i.imgur.com/AfHvNB9.png

To count the column "Asistencia" use:

    $asistencias = Eventos::whereNotNull('asistencia')->count();
    $carbon=Carbon::now();

to get today I use Carbon How can I count today's data? with column crated_at

I could use this but how do I count the data in the 'asistencia' column?

$posts = Eventos::whereDate('created_at', Carbon::today())->get();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire