/** * Execute the console command. * * @return mixed */ public function handle() { /* Retrieve a task that is not completed yet */ $task = ServerTask::where('completed', '0')->first(); if ($task) { $task->server->refresh(); switch ($task->action) { case "start": $this->start($task); break; case "create": $this->create($task); break; case "configure": $this->configure_server($task); break; } } else { $this->info('No tasks in queue.'); } }