After Eloquent query you can modify rows by using map()
function in Collections.
1$users = User::where('role_id', 1)->get()->map(function (User $user) {2 $user->some_column = some_function($user);3 return $user;4});
After Eloquent query you can modify rows by using map()
function in Collections.
1$users = User::where('role_id', 1)->get()->map(function (User $user) {2 $user->some_column = some_function($user);3 return $user;4});