laravel yajra datatable checkbox code example

Example 1: add checkbox in server side datatable laravel

->editColumn('select_orders', static function ($row) {
                return '<input type="checkbox" name="registrations[]"
                value="'.$row->id.'"/>';
            })->rawColumns(['select_orders'])
  
  Inside Config/datatables.php 
 'raw'       => ['action', 'checkbox'],

Example 2: yajra datatables add column checkbox

->editColumn('select_orders', static function ($row) {
            return '<input type="checkbox" name="registrations[]" value="'.$row->id.'"/>';
        })->rawColumns(['select_orders'])

Tags:

Misc Example