In a model I have a method with an SQL query to obtain the total sum of the concepts of a repair.
This is the method:
public function totalCon() {
$sql = "SELECT SUM(quantity*amount) FROM concepts WHERE repair_id = $this->repair_id";
$totalCon = DB::select($sql);
return $totalCon;
}
I have to show that result in a view, but when I call the method in the blade view it gives me the following error:
htmlspecialchars() expects parameter 1 to be string, array given
What I return in the method is an array with an object:
But in the blade view I need it to be a string and not an array with an object.
How do I convert that array with object to string? I only need to display the result of the float (3865)
Thank you