Set the default javascript type to module by setting Builder::useVite() in the AppServiceProvider.
namespace App\Providers;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider;
use Yajra\DataTables\Html\Builder;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Paginator::useBootstrapFive();
Builder::useVite();
}
}
Usage
Set the default javascript type to
module
by settingBuilder::useVite()
in the AppServiceProvider.