whereRaw('LENGTH(reference) > 8')->where('reference', 'not like', "%YW%")->where('owner_type', Order::class)->whereDate('created_at', '>=', Carbon::parse('20-09-2022'))->whereDoesntHave('containers'); } /** * @param $packingList * @return array */ public function map($packingList): array { $address = $packingList->owner->addresses()->where('status', ApprovalStatus::APPROVED)->first(); return [ $packingList->reference, $address->postcode ]; } }