Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel Eloquent sum of multiplied columns

$amount = Transaction::all()->sum(function($t){ 
    return $t->jumlah * $t->harga; 
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Laravel #Eloquent #sum #multiplied #columns
ADD COMMENT
Topic
Name
2+2 =