Level 51
DB::table('kits')
->select(['*', DB::raw('SUM(cost_value + 1000.00) filnal_price')])
->orderBy('cost_value')
->get();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
in MySql: SELECT *, cost_value + 1000.00 final_value FROM kits WHERE CODE = '231486V'
But in Laravel Query: DB::table('kits') ->select('*') ->select(DB::raw('SUM(cost_value + 1000.00) filnal_price')) ->orderBy('cost_value') ->get(); not work
In Laravel documentation not found a soluction.
Please or to participate in this conversation.