protected$description='Gets all the published articles that have yet to have subscribers notified and queues notification emails for all the subscribers in the list.';
/**
*Executetheconsolecommand.
*/
publicfunctionhandle()
{
$startTime=microtime(true);
// TODO: Incredibly basic implementation here. Won't scale well past a few thousand subscribers
$articlesForNotification=Article::query()
->where('published_at','<',now())
->whereNull('subscribers_notified_at')
->get();
logger(count($articlesForNotification).' article(s) ready for notifying.');