Example #1
0
 /**
  * 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.');
         }
     }
 }
 /**
  * Index of all suspend/unsuspend queued jobs
  */
 public function index()
 {
     return SuspendQueue::all();
 }