# 🚀 5 minute quick start
💡 Require this package in the composer.json
of your Laravel project. This will download the package and Laravel Excel.
composer require maatwebsite/laravel-nova-excel
1
💪 Go to your Nova resource. As example we'll use the app/Nova/User.php
. Add Maatwebsite\LaravelNovaExcel\Actions\DownloadExcel
action to your actions()
list.
<?php
namespace App\Nova;
use Illuminate\Http\Request;
use Maatwebsite\LaravelNovaExcel\Actions\DownloadExcel;
class User extends Resource
{
/**
* The model the resource corresponds to.
*
* @var string
*/
public static $model = 'App\\User';
// Other default resource methods
/**
* Get the actions available for the resource.
*
* @param \Illuminate\Http\Request $request
*
* @return array
*/
public function actions(Request $request)
{
return [
new DownloadExcel,
];
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
🔥 Go to your resource in your Nova admin panel, select all or some users and click "Download Excel"
📄 Find your users.xlsx
in your downloads folder!