How to use multiple checkbox with datatable using laravel?

By Than Htut Oo

enter image description here

I want to filter using multiple condition with checkbox.I am using yajrabox package and laravel 5.4.Now what am i facing the problem is that I can’t use multiple checkbox.
Here is my view

  <form method="POST" id="search-form" class="form-inline" role="form">
                       <div class="form-group">
 <?php $users = AppUser::all(); ?>  @foreach($users as $row)
 <input type="checkbox" name="email[]" value="{{ $row->email }}">  {{ $row->email }} @endforeach
            <button type="submit" class="btn btn-primary">Search</button>
<table id="users-table" class="table table-condensed">
            <th>Created At</th>
            <th>Updated At</th>

and here is my controller

    public function getCustomFilterData(Request $request)
        $users = User::select(['id', 'name', 'email', 'created_at', 'updated_at']);
        return Datatables::of($users)
            ->filter(function ($query) use ($request) {
                if ($request->has('name')) {
                    $query->where('name', 'like', "%{$request->get('name')}%");
                if ($request->has('email')) {
                    $query->where('email', 'like', "%{$request->get('email')}%");

and here is the javascript for datatable

var oTable = $('#users-table').DataTable({
        dom: "<'row'<'col-xs-12'<'col-xs-6'l><'col-xs-6'p>>r>"+
        processing: true,
        serverSide: true,
        ajax: {
            url: '{!! route('') !!}',
            data: function (d) {
       = $('input[name=name]').val();
       = $('input[name=email]').val();
        columns: [
            {data: 'id', name: 'id'},
            {data: 'name', name: 'name'},
            {data: 'email', name: 'email'},
            {data: 'created_at', name: 'created_at'},
            {data: 'updated_at', name: 'updated_at'}
    $('#search-form').on('submit', function(e) {

Here is my application user interface.

Now the submit button is not working now.
Please guide me. Thanks in advance.

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273