Are you sure $invoice->totalpricebyproducts() of type Illuminate\Database\Eloquent\Builder|mixed can be used in concatenation?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
21
echo "\ninvoice ".$invoice->id. ' should be ' . $invoice->total_price . ' vs ' . /** @scrutinizer ignore-type */ $invoice->totalpricebyproducts() .' real ';