PHP code example of batyukovstudio / apiato-swagger-generator

1. Go to this page and download the library: Download batyukovstudio/apiato-swagger-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/ */

    

batyukovstudio / apiato-swagger-generator example snippets


use Batyukovstudio\ApiatoSwaggerGenerator\Middlewares\SwaggerGeneratorMiddleware;

class HttpKernel extends LaravelHttpKernel
{
    protected $middleware = [
        // Laravel middlewares
        SwaggerGeneratorMiddleware::class,
        // other middlewares
    ];
}

use Batyukovstudio\ApiatoSwaggerGenerator\Traits\CanRecordTestResponses;

class YourParentTestCase extends AbstractTestCase
{
    use CanRecordTestResponses;
}

public function hasAdminRole(): bool
{
    return $this->hasRole(config('appSection-authorization.admin_role'));
}
bash
php artisan swagger:generate
bash
php artisan test