直接在 return
的最后调用原数据,不用传参
return Admin::content(function (Content $content) {
$content->header('会议');
$content->description('列表');
$content->row(function (Row $row) {
$row->column(6, function (Column $column) {
$column->append((
new Box(
Conference::pluck('date','date')->flatten(1)->all(), $this->grid()
)));
});
});
});
用 $this->tempData
代替闭包传值
$this->tempContentData = Conference::pluck('date','date')
->flatten(1)
->all();
return Admin::content(function (Content $content) {
$content->header('会议');
$content->description('列表');
$content->row(function (Row $row) {
$row->column(6, function (Column $column) {
$column->append((
new Box(
$this->tempContentData, $this->grid()
)));
});
});
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…