<?php

namespace Ignite\Core\Models\Grid;

use Illuminate\Database\Eloquent\Builder;
use Yajra\DataTables\DataTableAbstract;

abstract class EloquentTable extends AbstractTable
{
    /**
     * Get the datatable instance.
     *
     * @param Builder $query
     *
     * @return DataTableAbstract
     */
    public function dataTable($query = null): DataTableAbstract
    {
        return $this->initDataTable($this->datatables->eloquent($query ?? $this->query()));
    }
}
