title: Laravel: You cannot serialize or unserialize PDO instances when sending notifications
body: <p>Issue when sending a notification with Laravel when adding queueable to the notification. Looked around the vendor classes but couldn't see a reason why it would do this I can't even see any references to PDO anywhere? If someone could give us a hand</p>
  
  <p>Stack trace:</p>
  
  <pre><code>(1/1) PDOException
  You cannot serialize or unserialize PDO instances
  
  in Queue.php line 139
  at PDO-&gt;__sleep()
  at serialize(object(SendQueuedNotifications))
  in Queue.php line 139
  at Queue-&gt;createObjectPayload(object(SendQueuedNotifications), 'queues:users')
  in Queue.php line 110
  at Queue-&gt;createPayloadArray(object(SendQueuedNotifications), 'queues:users', '')
  in RedisQueue.php line 153
  at RedisQueue-&gt;createPayloadArray(object(SendQueuedNotifications), 'queues:users', '')
  in Queue.php line 88
  at Queue-&gt;createPayload(object(SendQueuedNotifications), 'queues:users', '')
  in RedisQueue.php line 91
  at RedisQueue-&gt;push(object(SendQueuedNotifications))
  in Dispatcher.php line 184
  at Dispatcher-&gt;pushCommandToQueue(object(RedisQueue), object(SendQueuedNotifications))
  in Dispatcher.php line 160
  at Dispatcher-&gt;dispatchToQueue(object(SendQueuedNotifications))
  in Dispatcher.php line 73
  at Dispatcher-&gt;dispatch(object(SendQueuedNotifications))
  in NotificationSender.php line 195
  at NotificationSender-&gt;queueNotification(array(object(BelongsTo)), object(ThreadStartedWithProfileNotification))
  in NotificationSender.php line 74
  at NotificationSender-&gt;send(array(object(BelongsTo)), object(ThreadStartedWithProfileNotification))
  in ChannelManager.php line 39
  at ChannelManager-&gt;send(object(BelongsTo), object(ThreadStartedWithProfileNotification))
  in Facade.php line 237
  at Facade::__callStatic('send', array(object(BelongsTo), object(ThreadStartedWithProfileNotification)))
  in UserNotification.php line 27
  at UserNotification::send(object(BelongsTo), object(ThreadStartedWithProfileNotification))
  in CreateController.php line 51
  at CreateController-&gt;__invoke(object(Request), object(Profile))
  at call_user_func_array(array(object(CreateController), '__invoke'), array(object(Request), object(Profile)))
  in BoundMethod.php line 32
  at BoundMethod::Illuminate\Container\{closure}()
  in BoundMethod.php line 90
  at BoundMethod::callBoundMethod(object(Application), array(object(CreateController), '__invoke'), object(Closure))
  in BoundMethod.php line 34
  at BoundMethod::call(object(Application), array(object(CreateController), '__invoke'), array('profile' =&gt; object(Profile)), null)
  in Container.php line 576
  at Container-&gt;call(array(object(CreateController), '__invoke'), array('profile' =&gt; object(Profile)))
  in RoutesRequests.php line 376
  at Application-&gt;callControllerCallable(array(object(CreateController), '__invoke'), array('profile' =&gt; object(Profile)))
  in RoutesRequests.php line 342
  at Application-&gt;callLumenController(object(CreateController), '__invoke', array(1, array('uses' =&gt; 'App\\Http\\Controllers\\Profile\\Messaging\\CreateController', 'middleware' =&gt; array('unsupported', 'unacceptable', 'auth:api')), array('profile' =&gt; object(Profile))))
  in RoutesRequests.php line 316
  at Application-&gt;callControllerAction(array(1, array('uses' =&gt; 'App\\Http\\Controllers\\Profile\\Messaging\\CreateController', 'middleware' =&gt; array('unsupported', 'unacceptable', 'auth:api')), array('profile' =&gt; object(Profile))))
  in RoutesRequests.php line 278
  at Application-&gt;callActionOnArrayBasedRoute(array(1, array('uses' =&gt; 'App\\Http\\Controllers\\Profile\\Messaging\\CreateController', 'middleware' =&gt; array('unsupported', 'unacceptable', 'auth:api')), array('profile' =&gt; object(Profile))))
  in RoutesRequests.php line 258
  at Application-&gt;Laravel\Lumen\Concerns\{closure}(object(Request))
  at call_user_func(object(Closure), object(Request))
  in Pipeline.php line 52
  at Pipeline-&gt;Laravel\Lumen\Routing\{closure}(object(Request))
  in Authenticate.php line 43
  at Authenticate-&gt;handle(object(Request), object(Closure), 'api')
  in Pipeline.php line 163
  at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request))
  at call_user_func(object(Closure), object(Request))
  in Pipeline.php line 32
  
  
  UserNotification::send($profile-&gt;user(), new ThreadStartedWithProfileNotification(
      $profile,
      $thread,
      $accountSending
  ));
  </code></pre>
  
  <p>UserNotification:</p>
  
  <pre><code>&lt;?php
  
  declare(strict_types=1);
  
  namespace Shared\Helpers;
  
  use App\Models\User;
  use RuntimeException;
  use Illuminate\Support\Collection;
  use Illuminate\Support\Facades\Notification;
  use Shared\Helpers\Contract\UserNotificationInterface;
  
  /**
   * Class UserNotification
   * @package Shared\Helpers
   */
  class UserNotification
  {
      /**
       * @param $recipients
       * @param UserNotificationInterface $notification
       * @return void
       */
      public static function send($recipients, UserNotificationInterface $notification) : void
      {
          self::validate($recipients);
          Notification::send($recipients, $notification);
      }
  
      /**
       * @param $recipients
       * @param UserNotificationInterface $notification
       * @return void
       */
      public static function sendNow($recipients, UserNotificationInterface $notification) : void
      {
          self::validate($recipients);
          Notification::sendNow($recipients, $notification);
      }
  
      /**
       * @param Collection|User $recipients
       * @return void
       */
      private static function validate($recipients) : void
      {
          if ($recipients instanceof User) {
              return;
          }
  
          $recipients-&gt;each(function ($recipient) {
              if (! $recipient instanceof User) {
                  throw new RuntimeException(sprintf(
                      'Recipient must be an instance of App\Models\User, %s given',
                      $recipient
                  ));
              }
          });
      }
  }
  </code></pre>
  
  <p>The actual notification:</p>
  
  <pre><code>&lt;?php
  
  declare(strict_types = 1);
  
  namespace App\Notifications\Individual;
  
  use App\Models\Account;
  use App\Models\Profile;
  use App\Models\Thread;
  use Illuminate\Bus\Queueable;
  use Illuminate\Notifications\Notification;
  use Illuminate\Contracts\Queue\ShouldQueue;
  use Illuminate\Notifications\Messages\MailMessage;
  use Shared\Helpers\Contract\UserNotificationInterface;
  use Shared\Helpers\Helper;
  
  /**
   * Class ThreadStartedWithProfile  Notification
   * @package App\Notifications\Individual
   */
  class ThreadStartedWithProfileNotification extends Notification implements ShouldQueue, UserNotificationInterface
  {
      use Queueable;
  
      /** @var Profile $application */
      protected $profile;
  
      /** @var Thread $thread */
      protected $thread;
  
      /** @var Account $account */
      private $account;
  
      /**
       * ThreadStartedWithProfileNotification constructor.
       * @param Profile $profile
       * @param Thread $thread
       * @param Account $account
       */
      public function __construct(Profile $profile, Thread $thread, Account $account)
      {
          $this-&gt;profile = $profile;
          $this-&gt;thread = $thread;
          $this-&gt;account = $account;
      }
  
      /**
       * Get the notification's delivery channels.
       *
       * @param  mixed  $notifiable
       * @return array
       */
      public function via($notifiable)
      {
          return ['mail', 'database'];
      }
  
      /**
       * Get the mail representation of the notification.
       *
       * @param  mixed  $notifiable
       * @return MailMessage
       */
      public function toMail($notifiable)
      {
          return (new MailMessage)
              -&gt;subject("{$this-&gt;account-&gt;name} Has Messaged You!")
              -&gt;greeting("Hello")
              -&gt;line("{$this-&gt;account-&gt;name} has messaged you on Digital Profile")
              -&gt;action('View', Helper::url('/messaging'))
          ;
      }
  
      /**
       * Get the array representation of the notification.
       *
       * @param  mixed  $notifiable
       * @return array
       */
      public function toArray($notifiable)
      {
          return [
              'uuid'  =&gt; $this-&gt;thread-&gt;uuid,
  
              'account' =&gt; [
                  'uuid' =&gt; $this-&gt;account-&gt;uuid,
                  'name' =&gt; $this-&gt;account-&gt;name,
                  'type' =&gt; $this-&gt;account-&gt;type-&gt;key,
              ],
          ];
      }
  }
  </code></pre>