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: 
If you previously updated your `"maatwebsite/excel"` package to 3.\*. version, the method `Excel::create($yourExport)` is removed. Instead you should use `Excel::download/Excel::store($yourExport)`.

Example how it should be used with new version:

```
use App\Exports\UsersExport;
use Maatwebsite\Excel\Facades\Excel;
use App\Http\Controllers\Controller;

class UsersController extends Controller 
{
    public function export() 
    {
        return Excel::download(new UsersExport, 'users.xlsx');
    }
}

```

Where `UsersExport` is a new class created by using the `make:export` command.

**UsersExport.php:**

```
<?php

namespace App\Exports;

use App\User;
use Maatwebsite\Excel\Concerns\FromCollection;

class UsersExport implements FromCollection
{
    public function collection()
    {
        return User::all();
    }
}

```

Here you can find official [Upgrade guide](https://docs.laravel-excel.com/3.1/getting-started/upgrade.html) to a new version.
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;

```