expireAfter(60)->dontRelease()]; } public function handle(): void { try { $this->cleanupInvitationLink(); $this->cleanupExpiredEmailChangeRequests(); } catch (\Throwable $e) { Log::error('CleanupInstanceStuffsJob failed with error: '.$e->getMessage()); } } private function cleanupInvitationLink() { $invitation = TeamInvitation::all(); foreach ($invitation as $item) { $item->isValid(); } } private function cleanupExpiredEmailChangeRequests() { User::whereNotNull('email_change_code_expires_at') ->where('email_change_code_expires_at', '<', now()) ->update([ 'pending_email' => null, 'email_change_code' => null, 'email_change_code_expires_at' => null, ]); } }