Your query returns an array with an object.
Try accessing the first element of the array with [0] and get the variable (total) with [0]->total
DB::table("Machines")->select(DB::raw('(SUM(cantidad)*SUM(cantidad_actual)) as total'))->get()[0]->total
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community