27 lines
751 B
PHP
27 lines
751 B
PHP
<?php
|
|
|
|
namespace App\Admin\Renderable;
|
|
|
|
use App\Models\CouponRange;
|
|
use App\Models\ProductSku;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Grid\LazyRenderable;
|
|
|
|
class CouponRangeSkuTable extends LazyRenderable
|
|
{
|
|
public function grid(): Grid
|
|
{
|
|
$rangeId = $this->payload['id'];
|
|
// dd($partId);
|
|
$couponRange = CouponRange::findOrFail($rangeId);
|
|
$builder = ProductSku::whereIn('id', explode(',', $couponRange->ranges));
|
|
|
|
return Grid::make($builder, function (Grid $grid) {
|
|
$grid->column('name', __('product-sku.fields.name'));
|
|
$grid->column('specs', __('product-sku.fields.specs'))->label();
|
|
$grid->quickSearch(['name']);
|
|
$grid->disableActions();
|
|
});
|
|
}
|
|
}
|