Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace AppListenersEnquiry;
- use AppEventsNewEnquiryEvent;
- use AppExceptionsDebuggableException;
- use IlluminateQueueInteractsWithQueue;
- use IlluminateContractsQueueShouldQueue;
- use AppModelsStoresEnquiry;
- class Tweet
- {
- public function handle(NewEnquiryEvent $event)
- {
- Enquiry::find($event->body->id)->reject(function ($enquiry) {
- return !$enquiry->shouldTweet();
- })->map(function ($enquiry) {
- return $enquiry->sendToTwitter();
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement