PHP code example of rdcstarr / docs-generator

1. Go to this page and download the library: Download rdcstarr/docs-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rdcstarr / docs-generator example snippets


'sources' => [
    'laravel' => [
        'driver'  => \Rdcstarr\DocsGenerator\Drivers\LaravelDriver::class,
        'version' => '13.x',
    ],
],

'providers' => [
    'groq' => [
        'class'    => \Rdcstarr\DocsGenerator\Providers\LaravelAiProvider::class,
        'provider' => 'groq',
        'model'    => env('GROQ_MODEL', 'llama-3.3-70b-versatile'),
        'timeout'  => env('GROQ_TIMEOUT', 60),
    ],
],

namespace App\DocsGenerator;

use Rdcstarr\DocsGenerator\Contracts\AIProvider;

class MyCustomProvider implements AIProvider
{
    public function __construct(array $config) { /* ... */ }

    public function generate(string $prompt): ?string
    {
        // call your API, return Markdown
    }
}

namespace App\DocsGenerator;

use Rdcstarr\DocsGenerator\Contracts\DocsDriver;

class FilamentDriver implements DocsDriver
{
    public function __construct(array $config) { /* ... */ }

    public function name(): string          { return 'filament'; }
    public function indexSection(): string  { return '## Filament'; }
    public function discoverPages(): array  { /* fetch + parse sidebar */ }
    public function fetchPage(string $url): ?string { /* fetch + clean HTML */ }
    public function buildPrompt(string $url, string $html): string { /* prompt */ }
}
bash
php artisan vendor:publish --provider="Laravel\Ai\AiServiceProvider"
php artisan migrate
bash
php artisan vendor:publish --tag=docs-generator-config
bash
php artisan docs:generate
bash
php artisan docs:generate laravel
php artisan docs:generate flux
php artisan docs:generate livewire
bash
php artisan docs:generate --for=cursor
php artisan docs:generate laravel --for=copilot
bash
php artisan docs:generate --force
bash
php artisan docs:generate laravel --only=routing,eloquent
bash
php artisan docs:generate --provider=openai
php artisan docs:generate --provider=anthropic
php artisan docs:generate --provider=gemini
bash
php artisan docs:generate --sync-only
php artisan docs:generate laravel --sync-only