title: pass data to laravel markdown with events
body: <p>Im using events to trigger an event to send emails to the user, but im getting an error when i tried to pass extra data. </p>
  
  <p>Order.php</p>
  
  <pre><code>    protected $events = [
         'created' =&gt; Events\NewOrder::class
      ];
  </code></pre>
  
  <p>NewOrder.php</p>
  
  <pre><code>use App\Order;
  class NewOrder
  {
     use Dispatchable, InteractsWithSockets, SerializesModels;
  
  
     public $order;
  
  
     public function __construct(Order $order)
     {
       $this-&gt;order = $order;
     }
  
  
     public function broadcastOn()
     {
       return new PrivateChannel('channel-name');
     }
  }
  </code></pre>
  
  <p>the Listener:</p>
  
  <pre><code> public function handle(NewOrder $event)
   {
  
      Mail::to(Auth::user()-&gt;email)-&gt;send( new UserOrder( $event-&gt;pedido));
   }
  </code></pre>
  
  <p>UserOrder.php</p>
  
  <pre><code> public function __construct(Order $order)
   {
      $this-&gt;order = $order;
      $id_order = $order-&gt;id;
      $details = DB::table('order_product')
              -&gt;where('order_id', '=', $id_order)
              -&gt;get();
      $this-&gt;$details = $details;
   }
  
  
   public function build()
   {
      return $this-&gt;markdown('emails.userorder')-&gt;with('details', $this-&gt;details);
   }
  </code></pre>
  
  <blockquote>
    <p>Markdown mail: userorder</p>
  </blockquote>
  
  <pre><code>@foreach($details as $detail)
   {{ $detail-&gt;description }} 
  @endforeach
  </code></pre>
  
  <p>gave me this error:
  Invalid argument supplied for foreach()</p>