Answers for "laravel get current month and year"

PHP
1

get current month record in laravel

User::whereMonth('created_at', date('m'))
->whereYear('created_at', date('Y'))
->get(['name','created_at']);
Posted by: Guest on February-09-2021
1

where year month laravel

$q->whereDay('created_at', '=', date('d'));
$q->whereMonth('created_at', '=', date('m'));
$q->whereYear('created_at', '=', date('Y'));
Posted by: Guest on July-11-2020

Code answers related to "laravel get current month and year"

Browse Popular Code Answers by Language