CardCertifiedListener.php 846 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Listeners;
  3. use App\Events\CardCertifiedEvent;
  4. use App\Repositories\InviteNewUserRepository;
  5. use Illuminate\Queue\InteractsWithQueue;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Illuminate\Support\Facades\Log;
  8. class CardCertifiedListener
  9. {
  10. protected $inviteNewUserRepository;
  11. /**
  12. * Create the event listener.
  13. *
  14. * @return void
  15. */
  16. public function __construct(InviteNewUserRepository $inviteNewUserRepository)
  17. {
  18. //
  19. $this->inviteNewUserRepository = $inviteNewUserRepository;
  20. }
  21. /**
  22. * Handle the event.
  23. *
  24. * @param CardCertifiedEvent $event
  25. * @return void
  26. */
  27. public function handle(CardCertifiedEvent $event)
  28. {
  29. //
  30. $user = $event->user;
  31. $this->inviteNewUserRepository->updateCardCertified($user->id);
  32. }
  33. }