Why I Stopped Using Raw SQL Date Functions and Switched to Carbon in Laravel

Chris Lloyd Fallaria
It Started With a Bug When I was building VMMS — a voucher management system for government offices — everything worked fine locally. MySQL. Clean queries. Fast results. Then I deployed to a server running MariaDB. Half my charts broke. The Problem I had written date queries like this all over the codebase: // This breaks on MariaDB DB :: table ( 'voucher_transactions' ) -> selectRaw ( 'MONTHNAME(created_at) as month, COUNT(*) as total' ) -> groupByRaw ( 'MONTH(created_at), MONTHNAME(created_at)