Detailed explanation of rare laravel frameworks and laravel frameworks
1. whereDate () method
1 $ q-> where ('created _ at', '> =', date ('Y-m-d'). '00:00:00 '));
In the previous data query, the where condition is used to determine the ratio, but the format has strict requirements. If the third parameter of the above Code is date ('Y-m-d ') if you do not add the following 00:00:00, you will not be able to find it in the database.
Determining whether they are equal also imposes strict format requirements.
$ Q-> whereDate ('created _ at', '=', date ('Y-m-d '));
Now the whereDate and laravel methods are used to automatically process the date format and ensure that the date format matches the search format.
$ Q-> whereDay ('created _ at', '=', date ('D'); $ q-> whereMonth ('created _ at', '= ', date ('M'); $ q-> whereYear ('created _ at', '=', date ('y '));
For example, in the above Code, when only a certain number of days is searched, whereDay will be used to search for the matching value of a certain day in the database.