Source: www.iankumu.com

How to Document a Laravel REST API
When building a https://www.iankumu.com/blog/laravel-rest-api/ it is almost a given that you have to create documentation for the API. Developers praise most popular software such as https://stripe.com/ for having good documentation and this has resulted in Stripe being used by a lot of developers.

Luckily for us, there are two popular packages that can help generate API documentation with minimal effort; https://swagger.io/ and https://scribe.knuckles.wtf/laravel/.

*/ 'exclude' => [ // '/health', 'admin.*' ], /* * Settings to be applied to all the matched routes in this group when generating documentation */ 'apply' => [ /* * Additional headers to be added to the example requests */ 'headers' => [ 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], /* * If no @response or @transformer declarations are found for the route, * Scribe will try to get a sample response by attempting an API call.

To summarize, your API documentation should follow these 3 C’s; Clear – One should be able to understand from a bird’s eye view what your API does
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners