I am very interested in the same.
Did you find the solution or help somewhere else?
What did for my project was to comment all methods regarding the API for example:
created a small php file that what does is to parse the comments of the method here is a sample of a comment:
/**
* Select all elements
*
* @param int $num_rows
* @param int $user_id
* @param string $search_term
* @return int
*/
So, it is really easy to generate documentation based on the comments of each method in the controller or model it depends how your architecture is.
I code methods, comment the methods and then I just run the script I did and that's all, it outputs an HTML file with all API methods documented.
Regards.
Hi Laravelers,
I'm currently making a RESTful API starter with Laravel 4.2. If that can help: https://github.com/merlosy/laravel-restful-api-starter Feedback is great!
For your issue, I would simply add a phpdocumentor.phar at the root of your project. http://www.phpdoc.org/ You have guidelines on the website to help you..
Cheers
If you're interested in Swagger for Laravel, I wrote Swaggervel (https://github.com/slampenny/Swaggervel) which can be downloaded from Github. It should take care of most of the heavy lifting for you.
I've installed swaggervel successfully, but don't really understand how to get it to generate the docs. Not sure what the big difference is between swaggervel and just downloading and using swagger.phar.
The app is in debug mode. Any tips/tricks on using your package?
Once you install Swaggervel, you just add some swagger annotations to your classes and it will just show up at /api-docs
Really easy, don't need to worry about configuration, routing, or anything really, it just works. One note I found confusing though, if you haven't added any annotations at all yet, then going to the swaggervel endpoint will give an error since swagger.phar that it uses throws an error.
BostjanOb said:
There is http://apidocjs.com/ which generates docs from annotation
Thanks. You saved my day. apiDoc works perfect with Laravel 5.1.
i think PHPDoc is a better solution. You can configure it and run a task to regenerate the documentation after each deployment.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community