andreaselia/laravel-api-to-postman

Argument count error when enable_formdata is true

tuandp opened this issue · 0 comments

  1. Add a route with reflection method
$router->get('showWithReflectionMethod', [ExampleController::class, 'showWithReflectionMethod'])->name('show-with-reflection-method');
  1. Method in controller
    public function showWithReflectionMethod(ExampleService $service): array
    {
        return $service->getRequestData();
    }
  1. ExampleService constructor
    public function __construct(Request $request)
    {
        $this->request = $request;
    }
  1. Set api-postman.enable_formdata => true

Error

ArgumentCountError: Too few arguments to function AndreasElia\PostmanGenerator\Tests\Fixtures\ExampleService::__construct()