title: Laravel email, pass variables
body: <p>I am trying to build emails in Laravel, and I have a trouble with this one, I want to send email every Monday therefore I want to trigger it as a command and schedule it (unless there is a better way?) Here's my email:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Mail;
  
  use App\Event;
  use Illuminate\Bus\Queueable;
  use Illuminate\Contracts\Queue\ShouldQueue;
  use Illuminate\Mail\Mailable;
  use Illuminate\Queue\SerializesModels;
  
      class MondayEmails extends Mailable
      {
          use Queueable, SerializesModels;
  
          /**
           * Create a new message instance.
           *
           * @return void
           */
          public function __construct()
          {
              $events = Event::limit(5)
                  -&gt;orderBy('title')
                  -&gt;get();
              return $events;
          }
  
          /**
           * Build the message.
           *
           * @return $this
           */
          public function build()
          {
              return $this-&gt;from('support@dev.com')
                          -&gt;view('emails.mondayEmail');
          }
      }
  </code></pre>
  
  <p>At this point $events does bring me back a collection.</p>
  
  <p>Here's my mail view:</p>
  
  <pre><code>@foreach ($events as $event)
      {{ $event-&gt;title }}
  @endforeach
  </code></pre>
  
  <p>and command:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Console\Commands;
  
  use App\Event;
  use App\Mail\MondayEmails;
  use Illuminate\Console\Command;
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Mail;
  
  class MondayEmail extends Command
  {
      /**
       * The name and signature of the console command.
       *
       * @var string
       */
      protected $signature = 'email:monday';
  
      /**
       * The console command description.
       *
       * @var string
       */
      protected $description = 'Monday Events being send!';
  
      /**
       * Create a new command instance.
       *
       * @return void
       */
      public function __construct()
      {
          parent::__construct();
      }
  
      /**
       * Execute the console command.
       *
       * @return mixed
       */
      public function handle(Request $request)
      {
          Mail::to('dev@gmail.com')-&gt;send(new MondayEmails());
  
      }
  }
  </code></pre>
  
  <p>and when I run it I get:</p>
  
  <blockquote>
    <p>[ErrorException]   Undefined variable: events (View:
    C:\xampp\htdocs\liveandnow\resources\views\emails\mondayEmail.blade.php)</p>
    
    <p>[ErrorException]   Undefined variable: events</p>
  </blockquote>
  
  <p>How can this be solved? Is this the right approach? Or you would do it differently.</p>