Skip to content
Icon

WARNING You're browsing the documentation for an old version of LARAVEL-DATATABLES. Consider upgrading your project to laravel-datatables 11.0.

XSS filtering

To prevent XSS attack on some of your columns, you can use escapeColumns api.

Escape selected fields

return Datatables::eloquent(Role::select())
->escapeColumns(['name'])
->make(true);

Escape all columns

return Datatables::eloquent(Role::select())
->escapeColumns()
->make(true);

Escape by output index

return Datatables::eloquent(Role::select())
->escapeColumns([0])
->make();