Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

icsbcn's avatar

phpDoc in Laravel

Is there a tool to document our code of projects in Laravel? Something like phpDocumentator?

0 likes
22 replies
icsbcn's avatar

Hello @malfait.robin and @mstnorris ,

Thank you so much for your responses! My problem isn't with the generation of documentation blocks. What I want is: In a Laravel project with all documentation blocks already written in different scripts php, create useful HTML documentation for developers... something similiar to: http://laravel.com/api/5.0/

Best regards, Iban Cardona.

icsbcn's avatar

Hello @mstnorris,

Yes! I think that phpDocumentor is a good option but I think that isn't integrated with Laravel, is it?

Best regards, Iban Cardona.

mstnorris's avatar

@icsbcn you don't need it to be integrated, phpDocumentor will just parse the docblocks.

Have you tried it? Are you having any issues? What is it that you wish to accomplish?

icsbcn's avatar

Hello @mstnorris,

Yes. I tried it with Laravel 4.2. The HTML pages were created correctly but I had problems with url in that pages... I mean:

Best regards, Iban Cardona.

TomasVotruba's avatar

Hey guys, I'm ApiGen maintainer and saw some links on Twitter. I'll try to help you the best I can.

If I understand this correctly, you need to use your own .css style?

icsbcn's avatar

Hello @TomasVotruba,

I used ApiGen and I liked it! In Laravel 4.2, I used this command to generate code: apigen generate --source ./app --exclude=*/commands/*,*/config/*,*/database/*,*/lang/*,*/start/*,*/storage/*,*/views/*,filters.php,routes.php --destination ./public/api --no-source-code

Result here: http://ibancardonasubiela.tk/public/api/index.html

Best regards, Iban Cardona.

brad's avatar

Has anyone been able to get phpdocumentor to work with a Laravel 5.1 project?

Seems to work fine for Laravel 4.2, but when I run this in a Laravel 5.1 project, it's not parsing any of my files. It can be reproduced on a new Laravel project.

When I view the debug output, I'm seeing:

  In the ProjectDescriptor are:         
  19 files
  0 top-level namespaces
  0 unresolvable parent classes
  1 phpDocumentor\Descriptor\NamespaceDescriptor elements  [] []

The "0 top level namespaces" tells me it's not finding anything.

I suspect that it has something to do with nikic/php-parser, since it is a different version on a L4.2 project vs. a L5.1 project. psy/psysh seems to want a specific version of nikic/php-parser.

besrabasant's avatar

any documentation for configuring Apigen?

I could not find any other than whats on README.

agilasadi's avatar

@MSTNORRIS - But ApiGen is used for generating API documentation, like swagger. phpDocumentor is used for generating code documentation out of code blocks

Griehle's avatar

There seems to be an issue with symphony and phpDocs though. I cannot get it do anything but tell me no.

spjoshis's avatar

I am using netbeans + phpDocumentor mostly in some project

Please or to participate in this conversation.