26 lines
679 B
PHP
26 lines
679 B
PHP
<?php
|
|
|
|
namespace App\Admin\Renderable;
|
|
|
|
use App\Models\ProductSku;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Grid\LazyRenderable;
|
|
|
|
class ProductSkuSimpleTable extends LazyRenderable
|
|
{
|
|
public function grid(): Grid
|
|
{
|
|
$partId = $this->part_id;
|
|
$builder = ProductSku::query();
|
|
// $builder->with('parts')->whereHas('parts', function ($query) use ($partId) {
|
|
// $query->where('id', $partId);
|
|
// });
|
|
return Grid::make($builder, function (Grid $grid) {
|
|
$grid->disableRowSelector(false);
|
|
$grid->column('name');
|
|
$grid->quickSearch(['name']);
|
|
$grid->disableActions();
|
|
});
|
|
}
|
|
}
|