laravel-admin同一个页面两个grid怎么分别导出各自的数据?

  • Laravel Version: 6.2
  • PHP Version: 7.3
  • Laravel-admin: 1.8
protected function grid()
{
        $tab = new Tab();
        $tab->add('图片', $this->results('image')->render(), true);
        $tab->add('文章', $this->results('post')->render());
        return $tab;
}
public function results($type)
{
        $grid = new Grid(new Result());
        $grid->setName($type . 'Results');
        $grid->model()->whereHasIn($type);
         // 省略其余代码
}

这样两个tab分别显示图片数据和文章数据,怎么才能两个tab里分别导出各自的数据呢?
阅读 1.4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进