title: Sending a file via form to email with Laravel (Localhost)
body: <p>Newbie to Laravel so be kind lol </p>
  
  <p>My config for mail.php is correct and emails are being received successfully for text inputs to gmail, but not sure exactly how to complete the task for files. I would appreciate some assistance or reference links. </p>
  
  <p>Thanks in advance!!</p>
  
  <p>Code in routes.php</p>
  
  <pre><code>Route::get('/', function()
  {
  return View::make('form');
  });
  
  Route::post('/form', function()
  {
          $data = ['firstname' =&gt; Input::get('firstname'), 'username' =&gt;        Input::get('username'), 'email' =&gt; Input::get('email'), 'resume' =&gt; Input::get('resume') ];
  
          $rules = array(
              'username' =&gt; 'Required|Min:7',
              'email'     =&gt; 'Required|Email',
              'firstname' =&gt; 'Required',
              'resume' =&gt; 'Required'
          );
  
  
          $validation = Validator::make(Input::all(), $rules);
  
          if ($validation-&gt;fails())
          {
              // Validation has failed.
              return Redirect::to('/')-&gt;withInput()-&gt;withErrors($validation);
          }
  
          else {
  
              Mail::send('emails.welcome', $data, function($message)
          {
              $message-&gt;to('mail@domain.net');
              $message-&gt;subject('Welcome to Laravel');
              $message-&gt;from('sender@domain.net');
  
  
          });
  
          return Redirect::to('/')-&gt;withInput()-&gt;with('success', 'Thank you for your submission.');
  
          }
  //
  });
  </code></pre>
  
  <p>Code in form.blade.php</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;Form&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  @if(Session::has('success'))
  &lt;div class="alert-box success"&gt;
      &lt;h2&gt;{{ Session::get('success') }}&lt;/h2&gt;
  &lt;/div&gt;
  @endif
  
      {{ Form::open(array('url' =&gt; '/form')) }}
          &lt;p&gt;{{ Form::label('email', 'E-Mail Address');}} &lt;br&gt;{{    Form::email('email', 'example@mail.com');}}&lt;/p&gt;
          {{ $errors-&gt;first('email') }}
  
          &lt;p&gt;{{ Form::label('username', 'Username');}} &lt;br&gt; {{Form::text('username');}}&lt;/p&gt;
          {{ $errors-&gt;first('username') }}
  
          &lt;p&gt;{{ Form::label('firstname', 'First Name');}} &lt;br&gt; {{Form::text('firstname');}}&lt;/p&gt;
          {{ $errors-&gt;first('firstname') }}
  
          &lt;p&gt;{{ Form::file('resume'); }}&lt;/p&gt;
  
          &lt;p&gt;{{Form::submit('Send Details');}}&lt;/p&gt;
  
      {{ Form::close() }}
  
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>