SuccessSignSureListener.php 787 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Listeners;
  3. use App\Events\SuccessSignSureEvent;
  4. use Illuminate\Contracts\Queue\ShouldQueue;
  5. use Illuminate\Queue\InteractsWithQueue;
  6. use Illuminate\Support\Facades\Log;
  7. use Overtrue\LaravelWeChat\Facade as EasyWechat;
  8. class SuccessSignSureListener
  9. {
  10. /**
  11. * Create the event listener.
  12. *
  13. * @return void
  14. */
  15. public function __construct()
  16. {
  17. //
  18. }
  19. /**
  20. * Handle the event.
  21. *
  22. * @param object $event
  23. * @return void
  24. */
  25. public function handle(SuccessSignSureEvent $event)
  26. {
  27. try{
  28. $facade=new EasyWechat;
  29. $facade->miniProgram()->subscribe_message->send($event->data);
  30. }catch (\Exception $exception){
  31. Log::error($exception);
  32. }
  33. }
  34. }