I am using Yajra datatable. I want to display data and filter data with the president name
I have 3 tables

```
1- Planes = id, title, description.

2- presidents = id, P_name.

3- Plane_president = plane_id , president_id

```

Plane Model:

```
public function president()
    {
        return $this->belongsToMany(President::class);
    }

```

President Model:

```
public function planes()
{
    return $this->belongsToMany(Plane::class);
}

```

My Controller :

```
public function index(Request $request)
    {
    if ($request->ajax()) {
            $query = Plane::with('presidents')->selectRaw('distinct planes.*');
            return $this->dataTable
                ->eloquent($query)
                ->addColumn('P_name', function (Plane $plane) {
                    return $plane->presidents->map(function($president) {
                        return str_limit($president->P_name);
                    })->implode('&lt;br&gt;');
                })
                ->make(true);
        }

        return view('planes.index');
    }

```

js code:

```
  <script type="text/javascript">
      $('#search').DataTable({
        processing: true,
        serverSide: true,
        ajax: '{{ route("plane.index") }}',
        columns: [
            {data: 'id', name: 'id'},
            {data: 'main_point', name: 'main_point'},
            {data: 'presidents[, ].P_name', name: 'president'},
        ]
    });
    </script>

```

I have this error

```
message "Undefined property: App\\Http\\Controllers\\PlaneController::$dataTable"

```

How to solve this error?