<?php

namespace Ignite\Core\Models\Grid;

abstract class QueryTable extends AbstractTable
{
    /**
     * Get the datatable instance.
     *
     * @param \Illuminate\Database\Query\Builder $query
     *
     * @return \Yajra\DataTables\DataTableAbstract
     */
    public function dataTable($query = null)
    {
        return $this->initDataTable($this->datatables->query($query ?? $this->query()));
    }
}
