title: How to export data in table with pagination to excel in laravel
body: <p>I want to export my data in table with pagination in laravel to excel how can? i use Maatwebsite in Github. </p>
  
  <p>My table in blade with pagination</p>
  
  <pre><code>&lt;form method="GET" action="{{route('excelexport')}}"&gt;
     &lt;div style="float: right;margin-top: -12px;"&gt;
        &lt;button type="submit" class="btn btn-outline-primary"&gt;
           &lt;i class="icon-file-excel"&gt;&lt;/i&gt; Export to Excel
        &lt;/button&gt;
     &lt;/div&gt;
  &lt;/form&gt;
  
  &lt;table cellpadding="10px" width="100%" class="table_str"&gt;
      &lt;thead style="font-size: 11px;"&gt;
          &lt;tr&gt;
              &lt;th&gt;col1 &lt;/th&gt;                    
              &lt;th&gt;col2 &lt;/th&gt;
              &lt;th&gt;col3 &lt;/th&gt;
              &lt;th&gt;col4 &lt;/th&gt;
              &lt;th&gt;col5 &lt;/th&gt;
              &lt;th&gt;col6 &lt;/th&gt;
              &lt;th&gt;col7 &lt;/th&gt;
         &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody style="font-size: 11.5px;"&gt;
          @foreach($result as $vals)
              &lt;tr scope="row" style="border-bottom: solid 1px #ccc"&gt;
                  &lt;td&gt;&gt;{{$vals-&gt;fixass_id}}&lt;/a&gt;&lt;/td&gt;
                  &lt;td&gt;{{$vals-&gt;brand_name}}&lt;/td&gt;
                  &lt;td&gt;{{$vals-&gt;model_name}}&lt;/td&gt;
                  &lt;td&gt;{{$vals-&gt;branch_name}}&lt;/td&gt;
                  &lt;td&gt;{{$vals-&gt;dep_name}}&lt;/td&gt;
                  &lt;td&gt;{{$vals-&gt;type}}&lt;/td&gt;
                  &lt;td&gt;{{$vals-&gt;condition}}&lt;/td&gt;
              &lt;/tr&gt;
          @endforeach
      &lt;/tbody&gt;
  &lt;/table&gt;
  {{ $result-&gt;links('pagination.default') }}
  </code></pre>
  
  <p>My route:</p>
  
  <pre><code>Route::get('excelexport','ReportController@createexcel')-&gt;name('excelexport');
  </code></pre>
  
  <p>My Controller</p>
  
  <pre><code>public function createexcel(){
     Excel::create('Report_Inventory', function ($excel) {
        $excel-&gt;sheet('All Record', function ($sheet) {       
          $sheet-&gt;rows(array(array('Fixasset', 'Service tag', 'Brand', 'Model', 'CPU', 'HDD', 'RAM', 'IP','Window','System Type','Fullname')
                  ))-&gt;freezeFirstRow();    
              });
          })-&gt;export('xls');
      }
  </code></pre>
  
  <p>How can i export data in these table to excel?</p>