title: Serialization of 'Closure' is not allowed in Laravel 5.3 Email Queue
body: <p>I am willing to send email to list of email address using <code>queue</code>. Without using queue my code is working fine but with queue it's showing following error:</p>
  
  <pre><code>Exception in Queue.php line 86: Serialization of 'Closure' is not allowed
  
      in /home/hizbul/Development/Projects/Laravel/fastskool/vendor/laravel/framework/src/Illuminate/Queue/Queue.php line 86
      at serialize(object(SendMessageToStudent)) in Queue.php line 86
      at Queue-&gt;createPayload(object(SendMessageToStudent), '') in DatabaseQueue.php line 81
      at DatabaseQueue-&gt;push(object(SendMessageToStudent)) in Dispatcher.php line 184
      at Dispatcher-&gt;pushCommandToQueue(object(DatabaseQueue), object(SendMessageToStudent)) in Dispatcher.php line 159
      at Dispatcher-&gt;dispatchToQueue(object(SendMessageToStudent)) in Dispatcher.php line 73
      at Dispatcher-&gt;dispatch(object(SendMessageToStudent)) in DispatchesJobs.php line 17
      at Controller-&gt;dispatch(object(SendMessageToStudent)) in MessageController.php line 49
      at MessageController-&gt;store(object(Request))
      at call_user_func_array(array(object(MessageController), 'store'), array(object(Request))) in Controller.php line 55
      at Controller-&gt;callAction('store', array(object(Request))) in ControllerDispatcher.php line 44
      at ControllerDispatcher-&gt;dispatch(object(Route), object(MessageController), 'store') in Route.php line 189
      at Route-&gt;runController() in Route.php line 144
      at Route-&gt;run(object(Request)) in Router.php line 653
      at Router-&gt;Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in StaffAndAdmin.php line 40
      at StaffAndAdmin-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in ModuleManager.php line 29
      at ModuleManager-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in SwitchDatabaseConnection.php line 36
      at SwitchDatabaseConnection-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
      at SubstituteBindings-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
      at VerifyCsrfToken-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
      at ShareErrorsFromSession-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
      at StartSession-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
      at AddQueuedCookiesToResponse-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
      at EncryptCookies-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
      at Pipeline-&gt;then(object(Closure)) in Router.php line 655
      at Router-&gt;runRouteWithinStack(object(Route), object(Request)) in Router.php line 629
      at Router-&gt;dispatchToRoute(object(Request)) in Router.php line 607
      at Router-&gt;dispatch(object(Request)) in Kernel.php line 268
      at Kernel-&gt;Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 51
      at Debugbar-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
      at CheckForMaintenanceMode-&gt;handle(object(Request), object(Closure)) in Pipeline.php line 137
      at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
      at Pipeline-&gt;Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
      at Pipeline-&gt;then(object(Closure)) in Kernel.php line 150
      at Kernel-&gt;sendRequestThroughRouter(object(Request)) in Kernel.php line 117
      at Kernel-&gt;handle(object(Request)) in index.php line 68
  </code></pre>
  
  <p>I am using <code>database</code> as queue driver.</p>
  
  <p>Following is my Queue job handler code:</p>
  
  <pre><code>    class SendMessageToStudent implements ShouldQueue
  {
      use InteractsWithQueue, Queueable, SerializesModels;
  
      private $data;
  
      /**
       * Create a new job instance.
       *
       * @param Request $request
       */
      public function __construct(Request $request)
      {
          $this-&gt;data = $request;
      }
  
      /**
       * Execute the job.
       *
       * @return void
       */
      public function handle()
      {
          $student = $this-&gt;data;
          $arrStudent = (new Message())-&gt;getEmailAddressList($student);
          Mail::to($arrStudent)-&gt;send(new MessageSent($student));
      }
  }
  </code></pre>
  
  <p>and dispatcher code:</p>
  
  <pre><code>$this-&gt;dispatch(new SendMessageToStudent($request));
  </code></pre>
  
  <p>I am expecting a feasible solution.</p>