/home/techb158/immovalet.com/platform/plugins/ecommerce/src/Tables
NameSizeModeActions
Reports/-0755rm
BrandTable.php53540644editdlrm
CustomerTable.php46940644editdlrm
DiscountTable.php42770644editdlrm
FlashSaleTable.php43380644editdlrm
OrderIncompleteTable.php32180644editdlrm
OrderTable.php66480644editdlrm
ProductAttributeSetsTable.php53410644editdlrm
ProductCategoryTable.php56840644editdlrm
ProductCollectionTable.php56820644editdlrm
ProductLabelTable.php44180644editdlrm
ProductTable.php82690644editdlrm
ProductTagTable.php43360644editdlrm
ReviewTable.php53900644editdlrm
TaxTable.php46640644editdlrm
Edit: /home/techb158/immovalet.com/platform/plugins/ecommerce/src/Tables/ReviewTable.php (5390B)
repository = $reviewRepository; if (!Auth::user()->hasAnyPermission(['review.edit', 'review.destroy'])) { $this->hasOperations = false; $this->hasActions = false; } } /** * {@inheritDoc} */ public function ajax() { $data = $this->table ->eloquent($this->query()) ->editColumn('product_id', function ($item) { if (!empty($item->product)) { return Html::link($item->product->url, $item->product_name, ['target' => '_blank'] ); } return null; }) ->editColumn('customer_id', function ($item) { return Html::link(route('customer.edit', $item->user->id), $item->user->name)->toHtml(); }) ->editColumn('star', function ($item) { return view('plugins/ecommerce::reviews.partials.rating', ['star' => $item->star])->render(); }) ->editColumn('checkbox', function ($item) { return $this->getCheckbox($item->id); }) ->editColumn('status', function ($item) { return $item->status->toHtml(); }) ->editColumn('created_at', function ($item) { return BaseHelper::formatDate($item->created_at); }) ->addColumn('operations', function ($item) { return view('plugins/ecommerce::reviews.partials.actions', compact('item'))->render(); }); return $this->toJson($data); } /** * {@inheritDoc} */ public function query() { $query = $this->repository->getModel() ->select([ 'id', 'star', 'comment', 'product_id', 'customer_id', 'status', 'created_at', ]) ->with(['user', 'product']); return $this->applyScopes($query); } /** * {@inheritDoc} */ public function columns() { return [ 'id' => [ 'title' => trans('core/base::tables.id'), 'width' => '20px', 'class' => 'text-left', ], 'product_id' => [ 'title' => trans('plugins/ecommerce::review.product'), 'class' => 'text-left', ], 'customer_id' => [ 'title' => trans('plugins/ecommerce::review.user'), 'class' => 'text-left', ], 'star' => [ 'title' => trans('plugins/ecommerce::review.star'), 'class' => 'text-center', ], 'comment' => [ 'title' => trans('plugins/ecommerce::review.comment'), 'class' => 'text-left', ], 'status' => [ 'title' => trans('plugins/ecommerce::review.status'), 'class' => 'text-center', ], 'created_at' => [ 'title' => trans('core/base::tables.created_at'), 'width' => '100px', 'class' => 'text-left', ], ]; } /** * {@inheritDoc} */ public function bulkActions(): array { return $this->addDeleteAction(route('reviews.deletes'), 'review.destroy', parent::bulkActions()); } /** * {@inheritDoc} */ public function getBulkChanges(): array { return [ 'status' => [ 'title' => trans('core/base::tables.status'), 'type' => 'select', 'choices' => BaseStatusEnum::labels(), 'validate' => 'required|in:' . implode(',', BaseStatusEnum::values()), ], 'created_at' => [ 'title' => trans('core/base::tables.created_at'), 'type' => 'date', ], ]; } /** * {@inheritDoc} */ public function renderTable($data = [], $mergeData = []) { if ($this->query()->count() === 0 && !$this->request()->wantsJson() && $this->request()->input('filter_table_id') !== $this->getOption('id') ) { return view('plugins/ecommerce::reviews.intro'); } return parent::renderTable($data, $mergeData); } }