Question: hi m trying to download db data in excel format,,, but when I click on download then it says: Call to undefined method Maatwebsite\Excel\Excel::create() 

code of controller:

```
    function excel()
{
 $pdf_data = DB::table('importpdfs')->get()->toArray();
 $pdf_array[] = array('Battery', 'No_of_questions_attempted', 'SAS', 'NPR', 'ST', 'GR');
 foreach($pdf_data as $pdf)
 {
  $pdf_array[] = array(
   'Battery'  => $pdf->Battery,
   'No_of_questions_attempted'   => $pdf->No_of_questions_attempted,
   'SAS'    => $pdf->SAS,
   'NPR'  => $pdf->NPR,
   'ST'   => $pdf->ST,
   'GR'   => $pdf->GR
  );
 }
 Excel::create('Pdf Data', function($excel) use ($pdf_array){
  $excel->setTitle('Pdf Data');
  $excel->sheet('Pdf Data', function($sheet) use ($pdf_array){
   $sheet->fromArray($pdf_array, null, 'A1', false, false);
  });
 })->download('xlsx');
}

```

Answer: 
The create method was removed with `laravel-excel` version `3.0`.

From the [upgrade guide](https://docs.laravel-excel.com/3.1/getting-started/upgrade.html#upgrading-to-3-from-2-1):

> 
> Excel::create() is removed and replaced by
>  Excel::download/Excel::store($yourExport)
> 
> 
> 

I would use the [quickstart guide](https://docs.laravel-excel.com/3.1/exports/) from their documentation.
You are probably not using the Facade and using the file directly, make sure you are using 

```
use Maatwebsite\Excel\Facades\Excel;

```

and not 

```
use Maatwebsite\Excel\Excel;

```