DB::statement(); for serial in table
DB::statement(DB::raw('set @serial=0'));
$list = Designation::orderBy('id','desc')
->get([
'id',
'title',
DB::raw('@serial := @serial +1 as serial')
]);
$list = Designation::orderBy('id','desc')
->get([
'id',
'title',
DB::raw('@serial := @serial +1 as serial')
]);
Comments
Post a Comment