Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 472 Bytes

raw-columns.md

File metadata and controls

20 lines (14 loc) · 472 Bytes

Raw Columns

By default, Laravel DataTables protects us from XSS attack by escaping all our outputs. In cases where you want to render an html content, please use rawColumns api.

use DataTables;

Route::get('user-data', function() {
	$model = App\User::query();

	return DataTables::eloquent($model)
				->addColumn('link', '<a href="#">Html Column</a>')
				->addColumn('action', 'path.to.view')
				->rawColumns(['link', 'action'])
				->toJson();
});