Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function reorderDepartments($id)
- {
- //runs on 'pilot/department/{id}/staffMembers/reorder'
- //runs when user changes the order via drag and drop of the staff members in the departments
- //updates the position of that staff member within this department.
- //$departmentID = $id;
- $ids = request()->input('ids');
- foreach ($ids as $position => $departmentID) {
- $department = Department::find($departmentID);
- $department->position = $position;
- $department->save();
- }
- return $ids;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement