user(); if (!$customer instanceof Customer) { throw new UnprocessableEntityHttpException('مشتری یافت نشد.'); } self::assertCustomerIdentityVerified($customer); if (!$customer->trade_active) { throw new UnprocessableEntityHttpException('امکان سفارش برای شما غیرفعال است.'); } $source = (string) $request->input('source'); if (!in_array($source, ['katod', 'maftoul', 'shamsh'], true)) { throw new UnprocessableEntityHttpException('نوع دارایی نامعتبر است.'); } $row = $service->submit( $customer, $source, max(0, (int) $request->input('rings15')), max(0, (int) $request->input('rings25')) ); return response()->json($row); } }