I have the below snippet which returns month from my created_at timestamp. I am wanting this to return as MM-YYYY but not sure of the syntax. This is in a laravel implementation. I have tried to add 'MONTH, YEAR' but no luck.
$data = [
'data' => Payment::selectSub('MONTH(created_at)', 'month')
->selectSub('SUM(payment_amount)', 'total_payments')
->groupBy('month')
->get()];
via Eden WebStudio