My problem is as follows ....
I have a route that receives the year and month to get some information in the bank.
When the month does not come I need to make the sum of all the months of the requested year.
if($month == 0){
$dbRegister = DB::table('tb_data')->select(DB::raw("SUM(tb_data.total_points) as total_points"));
}else{
$dbRegister = DB::table('tb_data')->select('tb_data.total_points');
}
$dbRegister->select(DB::raw('tb_data.user)....
If I leave the separate select this way it does not work. Could someone tell me?
Thank you: D