laravel/framework — pull request #3946 by philsturgeon (2014-03-20 22:06:30+00:00)
Title: Added whereDay() whereMonth() whereYear()

Allows you to do stuff like:

$total = $this->blogs
->where('status', '=', 'live')
->whereYear('created_at', '=', $year)
->whereMonth('created_at', '=', $month)
->get();

This is not just some silly "I like using PHP methods instead of MySQL functions" situation. The trouble here is if you are trying to use the same PHP to interface with any DB engine that Laravel supports then just referencing MySQL functions in the where() just doesnt work.

PyroCMS can be installed with SQLite, Postgres or MySQL, so if we reference MySQL functions in the models then no joy there.

Most use the same thing, SQLite is a little crazy, but this all works nicely.