发放奖品'; /** * @param Model|Authenticatable|HasPermissions|null $user * * @return bool */ protected function authorize($user): bool { return $user->can('dcat.admin.draw_activities.log_complete'); } // 确认弹窗信息 public function confirm() { return '您确定要发放中奖奖品吗?'; } // 处理请求 public function handle(Request $request) { $drawLog = DrawLog::findOrFail($this->getKey()); if (! $drawLog->isPending()) { return $this->response()->error('操作失败:中奖记录状态异常')->refresh(); } $drawLog->update([ 'status' => DrawLogStatus::Completed, ]); return $this->response()->success('操作成功')->refresh(); } }