title: Attach file to email in laravel 5
body: <p>Im trying to attach a file to an email in laravel but i cant get it to work no matter what i do. It sends the email but with no attachment. doesn't give any errors neither.</p>
  
  <pre><code>public function sendCv($job)
  {
      $cv = \App\File::where('id', Auth::user()-&gt;details-&gt;cv_id)-&gt;first();
  
      $cv_path = storage_path(). '/uploads/files/' . Auth::user()-&gt;id . "/" . $cv-&gt;identifier . "/" . $cv-&gt;name;
  
      $data = [];
  
      Mail::send('email.apply', $data, function ($message) use ($job, $cv_path) {
          $message-&gt;to('test@test.com')-&gt;from(Auth::user()-&gt;email)-&gt;subject('Application');
          $message-&gt;attach($cv_path);
      });
  
  }
  </code></pre>
  
  <p>Its also setting the 'to' part of my email to 'Holidays in United Kingdom' in mac mail and i cant work out why? </p>
  
  <p><img src="https://i.stack.imgur.com/tCE4v.png" alt="enter image description here"></p>
  
  <p>Can anyone help and advise why this isn't working</p>
  
  <p>EDIT:</p>
  
  <p>Adding a second argument in the ->to method sorted out the holiday in the uk bit but with regards to troubleshooting i have already done.</p>
  
  <p>I Dump and died the path to make sure it was correct and it is. I checked the file exists and it does. I made the path incorrect which then give me an error (which suggests its working with the correct path)</p>
  
  <p>Set up a file downloading working with the same path and it worked fine</p>
  
  <pre><code>    $cv_path = storage_path(). '/uploads/files/' . Auth::user()-&gt;id . "/" . $cv-&gt;identifier . "/" . $cv-&gt;name;
  
      $headers = array(
          'Content-Type: application/pdf',
          'Content-Type: application/octet-stream',
      );
  
      return Response::download($cv_path, $cv-&gt;name, $headers);
  </code></pre>
  
  <p>this works fine and the file downloads.</p>