title: Why Laravel 5 mail, I attached a .tmp file?
body: <p>I am trying to attach a file in an email that is sent from a form, the problem is that the file is coming to me <code>.tmp</code></p>
  
  <p>My Controller</p>
  
  <pre><code>public function choiceAnalyst(Request $request){
  
      $userSelect = $request-&gt;input('user');
      $data = User::where('id', '=', $userSelect)-&gt;first();
      $data-&gt;attach = $request-&gt;file('document')-&gt;getRealPath();
  
      Mail::to('eaquino@spi.com.ve')-&gt;send(new AnalystMonth($data));
  
      return redirect()-&gt;route('home', ['message' =&gt; 'Correo enviado correctamente']);
  }
  </code></pre>
  
  <p>My Class</p>
  
  <pre><code>class AnalystMonth extends Mailable
  {
      use Queueable, SerializesModels;
  
      public $user;
  
      /**
       * Create a new message instance.
       *
       * @return void
       */
      public function __construct(User $user)
      {
          $this-&gt;user = $user;
  
      }
  
      /**
       * Build the message.
       *
       * @return $this
       */
      public function build()
      {
          return $this-&gt;view('mails.analystMonth')-&gt;attach($this-&gt;user-&gt;attach);
      }
  }
  </code></pre>
  
  <p>I think I got <code>.tmp</code> by the <code>getRealPath()</code> method that I include when I pick up the file, but I'm not sure. How do I get my file to reach the .tmp extension?</p>