ao = $ao->withoutRelations(); } /** * Execute the job. */ public function handle(): void { // Remove echomail not collected from echomail_seenby DB::table('echomail_seenby') ->where('address_id',$this->ao->id) ->whereNotNull('export_at') ->whereNull('sent_at') ->delete(); // Remove FLAG_INTRANSIT from netmail that hasnt been delivered DB::table('netmails') ->where('tftn_id',$this->ao->id) ->whereRaw(sprintf('(flags & %d) > 0',Message::FLAG_INTRANSIT)) ->update(['flags'=>DB::raw(sprintf('(flags & ~%d)',Message::FLAG_INTRANSIT))]); // Remove files not collected DB::table('file_seenby') ->where('address_id',$this->ao->id) ->whereNotNull('export_at') ->whereNull('sent_at') ->delete(); } }