I need to be able to change objects on server, save those, and return results back to frontend part of application. So basically, I have some code that does manipulation of data, than Eloquent that does saving, and than I want to return Eloquent object back. Problem is that I have more than one object, that I'll manipulate, and right now, I'm putting all of them in array. When it comes back to my frontend all it has is this:
[{"incrementing":true,"timestamps":true,"exists":true}]
Here is the simplified code:
$results = array();
foreach ($tasks as $task){
//some manipulation
$result = Task::find($task['id']);
$result->order = $task['order'];
$result->save();
$results[] = $result;
}
return Response::json($results);