title: Call to a member function getRealPath() on null
body: <p>I wanted to ask on how can i put a error message if theres no uploaded file but they press the upload button. How can I put an error message if the getRealPath is empty?</p>
  
  <pre><code>public function importExcel()
      {
          if (empty(Input::file('import_file')-&gt;getRealPath())) {
              return back()-&gt;with('success','No file selected');
          }
          else {
          $path = Input::file('import_file')-&gt;getRealPath();
          $inserts = [];
          Excel::load($path,function($reader) use (&amp;$inserts)
          {
              foreach ($reader-&gt;toArray() as $rows){
                  foreach($rows as $row){
                      $inserts[] = ['biometrics' =&gt; $row['biometrics'], 'first_name' =&gt; $row['first_name'], 'last_name' =&gt; $row['last_name'], 'date' =&gt; $row['date'], 'emp_in' =&gt; $row['emp_in'], 'emp_out' =&gt; $row['emp_out']];
                  }
              }
          });
  
          if (!empty($inserts)) {
              DB::table('attendances')-&gt;insert($inserts);
              return back()-&gt;with('success','Inserted Record successfully');                  
          }
  
  
          return back();
          }
  
      }
  </code></pre>