getRow(); return empty($row->instance_id); } /** * 渲染操作按钮 * * @return string */ public function render2() { $row = $this->getRow(); // 实例化表单类并传递自定义参数 $form = ItemQuantityForm::make(); $form->payload([ 'id' => $this->getKey(), 'user_id' => $row->user_id, 'item_id' => $row->item_id, 'current_quantity' => $row->quantity, 'item_name' => $row->item->name ?? '未知物品' ]); return Modal::make() ->lg() ->title($this->title()) ->body($form) ->button(' ' . $this->title()); } }