whereDate('dispatch_date', '<', Carbon::today())->whereDate('dispatch_date', '>', Carbon::now()->subdays(30)); })->get(); Log::info("[TESTING] total containers: " . count($containers)); $sent = false; foreach ($containers as $container){ if($sent){ break; } foreach ($container->packingLists as $packingList){ if($sent){ break; } if(!($packingList->owner instanceof Order)) continue; $user = $packingList->owner->companyModule->employees()->first(); $user = User::where('email', 'dillonngoweijoon@gmail.com')->first(); Log::info("[TESTING] user: " . json_encode($user)); Log::info("[TESTING] packingList: " . json_encode($packingList)); $user->notify(new ShipmentDepartureEmail($user, $packingList)); $sent = true; } } $end = new Carbon(); $elapsedTime = $start->diff($end)->format('%H:%I:%S'); Log::info(Carbon::now() . ': End job - Test to attach a file from S3 bucket and trigger an email send. ElapsedTime: ' . $elapsedTime . '.'); } }