message_id) { return; } $current = config('database.default'); config(['database.default' => DB_NINJA_LOOKUP]); $lookupAccount = LookupAccount::whereAccountKey($accountKey) ->firstOrFail(); $lookupInvitation = LookupTicketInvitation::whereLookupAccountId($lookupAccount->id) ->whereInvitationKey($invitation->invitation_key) ->firstOrFail(); $lookupInvitation->message_id = $invitation->message_id; $lookupInvitation->save(); config(['database.default' => $current]); } }