发放奖品'; /** * @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()); try { DB::beginTransaction(); (new DrawActivityService())->sendPrize($drawLog); DB::commit(); return $this->response()->success('操作成功')->refresh(); } catch (\Exception $e) { DB::rollBack(); return $this->response()->error($e->getMessage())->refresh(); } } }