![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ledger.corals.io/Corals/modules/Ledger/DataTables/ |
<?php namespace Corals\Modules\Ledger\DataTables; use Corals\Foundation\DataTables\BaseDataTable; use Corals\Modules\Ledger\Models\Account; use Corals\Modules\Ledger\Transformers\AccountTransformer; use Yajra\DataTables\EloquentDataTable; class AccountsDataTable extends BaseDataTable { /** * Build DataTable class. * * @param mixed $query Results from query() method. * @return \Yajra\DataTables\DataTableAbstract */ public function dataTable($query) { $this->setResourceUrl(config('ledger.models.account.resource_url')); $dataTable = new EloquentDataTable($query); return $dataTable->setTransformer(new AccountTransformer()); } /** * Get query source of dataTable. * @param Account $model * @return \Illuminate\Database\Eloquent\Builder|static */ public function query(Account $model) { return $model->newQuery(); } /** * Get columns. * * @return array */ protected function getColumns() { return [ 'id' => ['visible' => false], 'name' => ['title' => trans('Ledger::attributes.account.name')], 'email' => ['title' => trans('Ledger::attributes.account.email')], 'phone' => ['title' => trans('Ledger::attributes.account.phone')], 'address' => ['title' => trans('Ledger::attributes.account.address')], 'updated_at' => ['title' => trans('Corals::attributes.updated_at')], ]; } public function getFilters() { return [ 'name' => ['title' => trans('Ledger::attributes.account.name'), 'class' => 'col-md-2', 'type' => 'text', 'condition' => 'like', 'active' => true], 'email' => ['title' => trans('Ledger::attributes.account.email'), 'class' => 'col-md-3', 'type' => 'text', 'condition' => 'like', 'active' => true], 'phone' => ['title' => trans('Ledger::attributes.account.phone'), 'class' => 'col-md-2', 'type' => 'text', 'condition' => 'like', 'active' => true], 'address' => ['title' => trans('Ledger::attributes.account.address'), 'class' => 'col-md-2', 'type' => 'text', 'condition' => 'like', 'active' => true], ]; } }