addDays(7); $assets = Asset::with('assigneduser')->whereNotNull('expected_checkin')->where('expected_checkin', '<=', $whenNotify)->get(); $this->info($whenNotify.' is deadline'); $this->info($assets->count().' assets'); foreach ($assets as $asset) { if ($asset->assigneduser) { $asset->assigneduser->notify((new ExpectedCheckinNotification($asset))); //$this->info($asset); } } } }