Skip to content

Commit 3f7e9c9

Browse files
committed
Add usage docs.
1 parent f8a7efd commit 3f7e9c9

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

README.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,61 @@
33
[![Laravel 8.x](https://img.shields.io/badge/Laravel-8.x-orange.svg)](http://laravel.com)
44
[![Latest Stable Version](https://img.shields.io/packagist/v/yajra/laravel-datatables-export.svg)](https://packagist.org/packages/yajra/laravel-datatables-export)
55
[![Build Status](https://travis-ci.org/yajra/laravel-datatables-export.svg?branch=master)](https://travis-ci.org/yajra/laravel-datatables-export)
6-
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/yajra/laravel-datatables-export/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/yajra/laravel-datatables-export/?branch=master)
76
[![Total Downloads](https://img.shields.io/packagist/dt/yajra/laravel-datatables-export.svg)](https://packagist.org/packages/yajra/laravel-datatables-export)
87
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://packagist.org/packages/yajra/laravel-datatables-export)
98

109
This package is a plugin of [Laravel DataTables](https://github.com/yajra/laravel-datatables) for handling server-side exporting using Queue and Livewire.
1110

1211
## Requirements
12+
1313
- [PHP >=7.4](http://php.net/)
1414
- [Laravel 8.x](https://github.com/laravel/framework)
15+
- [Laravel Livewire](https://laravel-livewire.com/)
1516
- [Laravel DataTables 9.x](https://github.com/yajra/laravel-datatables)
1617
- [jQuery DataTables v1.10.x](http://datatables.net/)
17-
- [jQuery DataTables Buttons Extension](https://datatables.net/reference/button/)
1818

1919
## Documentations
20+
2021
- [Laravel DataTables Documentation](http://yajrabox.com/docs/laravel-datatables)
2122

2223
## NOTE
23-
This version is still on experimental stage. Until Laravel DataTables v8.x stable version is released,
24-
there might be a breaking changes that may be included on future releases.
24+
25+
This version is still on experimental stage.
2526

2627
## Quick Installation
28+
2729
`composer require yajra/laravel-datatables-export`
2830

2931
#### Service Provider (Optional on Laravel 5.5)
32+
3033
`Yajra\DataTables\ExportServiceProvider::class`
3134

3235
#### Configuration and Assets (Optional)
36+
3337
`$ php artisan vendor:publish --tag=datatables-export --force`
3438

35-
And that's it! Start building out some awesome DataTables!
39+
## Usage
40+
41+
1. Add the export-button livewire component on your view file that uses dataTable class.
42+
43+
```phpt
44+
<livewire:export-button :table-id="$dataTable->getTableAttribute('id')" />
45+
```
46+
47+
2. On your `DataTable` class instance, use `WithExportQueue`
48+
49+
```phpt
50+
use Yajra\DataTables\WithExportQueue;
51+
52+
class PermissionsDataTable extends DataTable
53+
{
54+
use WithExportQueue;
55+
56+
...
57+
}
58+
```
59+
60+
3. Run your queue worker via `php artisan queue:work`.
3661

3762
## Contributing
3863

0 commit comments

Comments
 (0)