Level 19
Apr 26, 2023
1
Level 1
expressions in withSum with Laravel 10
Before the update inside the withSum() function I could insert an expression as a column, in my specific case I multiplied the value of two columns.
->withSum(rel, DB::raw('column1 * column2'))
With laravel 10 I can't do that, because Eloquent translates the multiplication between two columns as a single column with that name.
Has anyone run into the same problem and found a solution?
Please or to participate in this conversation.