Swagger to Laravel Library

Given an OpenAPI API endpoint, if you can export the OpenAPI JSON specification, it can easily be turned into a client library for use in laravel.

Download the swagger.json file to the current folder.


docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i "/local/swagger.json" -g php -o /local/out/php

Under the ./out/ folder is now a client library to work against the API.

I made use of this post when working through: