I have to refactor some code for work, but i´m stuck with this statement: DB::raw('MAX(cred.id) as Last_id')
.
Does anyone know how to replase it using Laravel´s Query builder?
My Answer:
You can replace the DB::raw() statement with the following code using Laravel's Query Builder:
php
->selectRaw('MAX(cred.id) as Last_id')
This will achieve the same result as the DB::raw() statement in your code.
Rate this post
5 of 5 based on 7565 votesComments