Shorten code

This commit is contained in:
James Brooks
2015-05-13 08:08:45 +01:00
parent fe1425a6c0
commit 9b4e626447

View File

@@ -47,8 +47,8 @@ class ApiController extends AbstractController
{
$componentData = Binput::all();
foreach ($componentData['ids'] as $order => $componentId) {
$component = Component::find($componentId);
$component->update(['order' => $order + 1]); // Ordering should be 1-based, data comes in 0-based
// Ordering should be 1-based, data comes in 0-based
Component::find($componentId)->update(['order' => $order + 1]);
}
return $componentData;