PHP code example of storinka / invoke-api-document

1. Go to this page and download the library: Download storinka/invoke-api-document 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/ */

    

storinka / invoke-api-document example snippets


use Invoke\Toolkit\Docs\ApiDocumentExtension;

$invoke->registerExtension(ApiDocumentExtension::class);

$invoke->setConfig([
    "apiDocument" => [
        // Name of the API
        "name" => "Invoke API Document",

        // Short description of the API
        "summary" => "API documentation by Invoke API Document.",

        // Url to API icon
        "iconUrl" => "https://user-images.githubusercontent.com/21020331/145628046-ca19dbdf-2935-49fe-934c-a171219566cc.png",

        // Show only icon without name in header
        "iconOnly" => true,
        
        // Documentation sections
        "sections" => [
            // Default section with list of methods
            \Invoke\Toolkit\Docs\Sections\MethodsSection::class
            
            // You can put here your custom sections
        ],
        
        // Documentation methods
        "methods" => [
            "getApiDocument" => [
                "enabled" => true,
                "method" => \Invoke\Toolkit\Docs\Methods\GetApiDocument::class
            ]
        ],
        
        // Invoke instruction
        "invokeInstruction" => [
            // Name of the instruction
            "name" => "fetch",
            
            // Server protocol
            "protocol" => "http",
            
            // Server host
            "host" => "localhost",
            
            // Server port
            "port" => 8081,
            
            // Url path
            "path" => "",
        ]
    ]
]);