get column total in controller in laravel code example
Example: sum row data and get all data eloquent laravel
$balance = DB::table('data')->where('user_id' '=' $id)->sum('balance');
$balance = DB::table('data')->where('user_id' '=' $id)->sum('balance');