Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. namespace AppListenersEnquiry;
  4.  
  5. use AppEventsNewEnquiryEvent;
  6. use AppExceptionsDebuggableException;
  7. use IlluminateQueueInteractsWithQueue;
  8. use IlluminateContractsQueueShouldQueue;
  9. use AppModelsStoresEnquiry;
  10.  
  11. class Tweet
  12. {
  13. public function handle(NewEnquiryEvent $event)
  14. {
  15. Enquiry::find($event->body->id)->reject(function ($enquiry) {
  16. return !$enquiry->shouldTweet();
  17. })->map(function ($enquiry) {
  18. return $enquiry->sendToTwitter();
  19. });
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement