Skip to content

Instantly share code, notes, and snippets.

@geomagilles
Last active July 21, 2018 16:27
Show Gist options
  • Save geomagilles/90d2b16723aa27cb1efe75e64349accc to your computer and use it in GitHub Desktop.
Save geomagilles/90d2b16723aa27cb1efe75e64349accc to your computer and use it in GitHub Desktop.
<?php
...
public function handle()
{
...
// if no response received in 3 days
if (0 == count($this->quotations)) {
(new NotifyUserOfNoResponse($this->request))->execute();
return;
}
// notify quotation to user
(new NotifyQuotationsToUser($this->request, $this->quotations))->execute();
// wait user choice
$event = (new Wait(QuotationChosenByUserEvent::class))->execute();
// notify user choice to providers
foreach ($this->quotations as $providerId => $quotation) {
if ($providerId == $selected) {
(new NotifiyChosenProvider($providerId, $this->request))->dispatch();
} else {
(new NotifiyNotChosenProvider($providerId, $this->request))->dispatch();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment