Skip to content

Commit c38e8cf

Browse files
committed
docs: usage with vitejs
1 parent 72bc6d8 commit c38e8cf

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,29 @@ This package is a plugin of [Laravel DataTables](https://github.com/yajra/larave
3131

3232
`composer require yajra/laravel-datatables-html:^10`
3333

34-
#### Service Provider (Optional on Laravel 5.5+)
35-
36-
`Yajra\DataTables\HtmlServiceProvider::class`
34+
#### Setup scripts with ViteJS
35+
36+
Set the default javascript type to `module` by setting `Builder::useVite()` in the `AppServiceProvider`.
37+
38+
```php
39+
namespace App\Providers;
40+
41+
use Illuminate\Pagination\Paginator;
42+
use Illuminate\Support\ServiceProvider;
43+
use Yajra\DataTables\Html\Builder;
44+
45+
class AppServiceProvider extends ServiceProvider
46+
{
47+
/**
48+
* Bootstrap any application services.
49+
*/
50+
public function boot(): void
51+
{
52+
Paginator::useBootstrapFive();
53+
Builder::useVite();
54+
}
55+
}
56+
```
3757

3858
#### Publish Assets (Optional)
3959

0 commit comments

Comments
 (0)