$command->name, 'status' => $command->status, 'message' => $command->message, 'visible' => $command->visible, 'component' => $command->component_id, ]); // Update the component. if ($command->component_id) { Component::find($command->component_id)->update([ 'status' => $command->component_status, ]); } // Notify subscribers. if ($command->notify) { event(new IncidentWasReportedEvent($incident)); } return $incident; } }