identitySend('GET', '/api/identity/support/tickets?user='.urlencode((string) ladill_account()->public_id), []); return response()->json(['data' => $response->json('data', [])]); } public function ticket(int $ticket): JsonResponse { $response = $this->identitySend( 'GET', '/api/identity/support/tickets/'.$ticket.'?user='.urlencode((string) ladill_account()->public_id), [], ); if ($response->status() === 404) { return response()->json(['message' => 'Ticket not found.'], 404); } return response()->json(['data' => $response->json('data')]); } public function store(Request $request): JsonResponse { $data = $request->validate([ 'subject' => ['required', 'string', 'max:255'], 'message' => ['required', 'string', 'max:5000'], 'priority' => ['sometimes', 'in:low,normal,high'], ]); $response = $this->identitySend('POST', '/api/identity/support/tickets', array_merge( ['user' => ladill_account()->public_id], $data, )); $this->rethrowValidation($response, 'subject'); return response()->json(['data' => $response->json('data')], 201); } }