title: How to fix Call to undefined method Maatwebsite\Excel\Excel::create()?
body: <p>My program produces this error but I don't know why:</p>
  
  <blockquote>
    <p>Call to undefined method Maatwebsite\Excel\Excel::create()</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>public function exportExcel(){
      $users = User::all();
      $user_array = array('Name', "Email");
      foreach($users as $user){
          $user_array[] = array(
              'Name' =&gt; $user-&gt;name,
              'Email' =&gt; $user-&gt;email,
          );
  
      }
      Excel::create('User Data', function ($excel) use ($user_array){
          $excel-&gt;setTitle('User Data');
          $excel-&gt;sheet('User Data', function($sheet) use ($user_array){
           $sheet-&gt;fromArray($user_array);
          });
         })-&gt;download('xls');
      return redirect()-&gt;route('admin.page');
  }
  </code></pre>