#Compare just the month and year of two complete dates with eloquent ORM

6 messages · Page 1 of 1 (latest)

velvet coral
#

Hi!

How do I compare just the month and year of two complete dates with eloquent ORM?
I'm doing it this way, entering the format. But it is only valid in the option that is compared

$percentual = Teto::where('mes_ano', ($cert->empenho->data_empenho)->format('m/Y'))->get();
            Log::info($percentual);```
bronze bough
#

There are the whereMonth and whereYear query methods.

#

Have you tried those?

velvet coral