use IlluminateSupportFacadesDB; public function setNewOrder($ids) { DB::transaction(function () use ($ids) { Page::saveTreeFromIds($ids); }, 3); }