Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

547
Visualizações
How can I serve generated phpDocumentor docs from Laravel?

So I'm using phpDocumentor 3 to generate documentation for my Laravel 7 project,

and was wondering if I could serve this documentation (static files) from Laravel in order to make it available only to authorized users.

I would like to be able to update the documentation through my CI/CD, so I can't just modify manually the generated documentation.

I think that I might have to write my own template (https://docs.phpdoc.org/3.0/guide/guides/templates.html) for that but I'm not sure whether the documentation is incomplete or if I'm missing something because I have no idea how to create a template. Any suggestions, guides or tutorials that can help me achieve this please ?
Thank you

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can include the phpDoc generation within your CI/CD script:

first install the phpDocumentor on the production, then generate using this command:

phpDocumentor -d . -t storage/docs/ 

Note: the storage path maybe is gitIgnored if you plan to generate the phpDocs, not on the production server, you have to be sure that the folder will be pushed to the production

add this to the config/filesystem.php 'disks':

'local-docs' => [
            'driver' => 'local',
            'root' => storage_path('docs'),
        ],

and add the following in your routes file (routes/web.php)

Route::get('/docs/{url?}', function ($url) {
    $resp = response(Storage::disk('local-docs')->get($url));
    $resp->header('content-type', GuzzleHttp\Psr7\MimeType::fromFilename($url));
    return $resp;

})->where('url', '(.*)')->middleware('auth');

be sure you haven't any other route with the docs prefix

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda