getKey()); // return $this->response()->success('Processed successfully.')->redirect('/'); } public function render() { $id = "recharge-{$this->getKey()}"; // 模态窗 $this->modal($id); return << 审核 HTML; } protected function modal($id) { // 工具表单 $form = new Check($this->getKey()); // 在弹窗标题处显示当前行的用户名 $username = $this->row->username; // 通过 Admin::html 方法设置模态窗HTML Admin::html( << HTML ); } // /** // * 添加JS // * // * @return string // */ // protected function script() // { // return <<getKey(); // // // 获取当前行数据的用户名 // $username = $this->row->username; // // // 这里需要添加一个class, 和上面script方法对应 // $this->setHtmlAttribute(['data-id' => $id, 'email' => $username, 'class' => 'grid-check-row']); // // return parent::html(); // } /** * @return string|array|void */ public function confirm() { // return ['Confirm?', 'contents']; } /** * @param Model|Authenticatable|HasPermissions|null $user * * @return bool */ protected function authorize($user): bool { return true; } /** * @return array */ protected function parameters() { return []; } }