order($run); $instance = $this->instance($run); $instance->update(['status' => 'active']); $order->update(['status' => 'active']); foreach (['invite_users', 'upload_logo', 'connect_desktop', 'explore_apps'] as $key) { $instance->onboardingTasks()->firstOrCreate(['key' => $key], ['done' => false]); } // Deliver the initial credentials, then scrub the transient password. $encrypted = $run->context('admin_password'); if ($encrypted !== null) { Notification::route('mail', $order->customer->email)->notify( new CloudReady($instance, (string) $instance->nc_admin_ref, Crypt::decryptString($encrypted)), ); $run->forgetContext('admin_password'); } return StepResult::advance(); } }