<?php
namespace App\Admin\Actions\Feeds;
use App\Models\FeedForward;
use Dcat\Admin\Grid;
use Dcat\Admin\Grid\LazyRenderable;

class ForwardList extends LazyRenderable
{
    public function grid(): Grid
    {
        $grid = new Grid(new FeedForward());
        $grid->model()->with('user:id,name,avatar')->where('feed_id',$this->payload['id'])->orderByDesc('id');

        $grid->column('user.id');
        $grid->column('user.name');
        $grid->column('user.avatar')->image('',50);
        $grid->column('created_at');
        $grid->quickSearch(['user.name']);
        $grid->paginate(10);

        $grid->disableActions();
//        $grid->actions(function (Grid\Displayers\Actions $actionss) {
//            $actionss->disableView();
//            $actionss->disableEdit();
//        });

        return $grid;
    }
}
