Download exports

Downloading an export of your resource is very easy.

In your resource class, add the Maatwebsite\LaravelNovaExcel\Actions\DownloadExcel to actions().

use Maatwebsite\LaravelNovaExcel\Actions\DownloadExcel;

public function actions(Request $request)
{
    return [
        new DownloadExcel(),
    ];
}
1
2
3
4
5
6
7
8

Now you should see "Download Excel" in your list of actions.

Download Excel

When clicking a users.xlsx document will be downloaded. The name of the file is derived from the name of the resource.