/** * Execute the console command. * * @return mixed */ public function handle() { $requestTime = $_SERVER['REQUEST_TIME']; $queuedForSuspend = SuspendQueue::whereAction(1)->get(); foreach ($queuedForSuspend as $job) { $provisioningRecord = Provisioning::findOrFail($job->provisioning_id); $disable = $provisioningRecord->disableUserPorts(); if ($disable == '0') { logThis('GASuspendQueueRun: ONT for ' . $provisioningRecord->customer->name . ' back online. Service suspended.'); } elseif ($disable == '1') { logThis('GASuspendQueueRun: ONT for ' . $provisioningRecord->customer->name . ' still offline. Re-queueing suspension.'); } elseif ($disable == '2') { logThis('GASuspendQueueRun: ONT for ' . $provisioningRecord->customer->name . ' back online, but there was an error suspending service.'); } } }
/** * Reset an ONT to factory defaults */ public function reset(Request $request) { $provisioningRecord = Provisioning::findOrFail($request->id); return $provisioningRecord->resetToFactory(); }