DistDistributorTable.php 1.0 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Admin\Renderable;
  3. use App\Admin\Repositories\DistAdminDistributor;
  4. use Dcat\Admin\Grid;
  5. use Dcat\Admin\Grid\LazyRenderable;
  6. class DistDistributorTable extends LazyRenderable
  7. {
  8. public function grid(): Grid
  9. {
  10. return Grid::make(DistAdminDistributor::with(['appearance']), function (Grid $grid) {
  11. $grid->view('admin.grid.table');
  12. $grid->column('id')->width('5%');
  13. $grid->column('client_code', admin_trans_label('client_code'))->width('25%');
  14. $grid->column('distr_email',admin_trans_label('email'));
  15. $grid->column('dist_contact_number',admin_trans_label('contact_number'));
  16. $grid->column('country');
  17. $grid->disableActions();
  18. $grid->paginate(10);
  19. // $grid->filter(function (Grid\Filter $filter) {
  20. // $filter->like('client_code')->width(4);
  21. // });
  22. $grid->quickSearch('client_code');
  23. $grid->model()->where('enabled', 1)->orderBy('id', 'desc');
  24. });
  25. }
  26. }