public function generate($filename)
    {
        $securityConfig = config('swagger-lume.security', []);

        if (is_array($securityConfig) && ! empty($securityConfig)) {
            $documentation = collect(
                json_decode(file_get_contents($filename))
            );

            $openApi3 = version_compare(config('swagger-lume.swagger_version'), '3.0', '>=');

            $documentation = $openApi3 ?
                $this->generateOpenApi($documentation, $securityConfig) :
                $this->generateSwaggerApi($documentation, $securityConfig);

            file_put_contents($filename, $documentation->toJson());
        }
    }
public function generate($filename)
    {
        $securityConfig = config('swagger-lume.security', []);

        if (is_array($securityConfig) && ! empty($securityConfig)) {
            $documentation = collect(
                json_decode(file_get_contents($filename))
            );

            $openApi3 = version_compare(config('swagger-lume.swagger_version'), '3.0', '>=');

            $documentation = $openApi3 ?
                $this->generateOpenApi($documentation, $securityConfig) :
                $this->generateSwaggerApi($documentation, $securityConfig);

            file_put_contents($filename, $documentation->toJson());
        }
    }
public function generate ( $ filename ) { $ securityConfig = config ( 'swagger-lume.security' , [ ] ) ; if ( is_array ( $ securityConfig ) && ! empty ( $ securityConfig ) ) { $ documentation = collect ( json_decode ( file_get_contents ( $ filename ) ) ) ; $ openApi3 = version_compare ( config ( 'swagger-lume.swagger_version' ) , '3.0' , '>=' ) ; $ documentation = $ openApi3 ? $ this -> generateOpenApi ( $ documentation , $ securityConfig ) : $ this -> generateSwaggerApi ( $ documentation , $ securityConfig ) ; file_put_contents ( $ filename , $ documentation -> toJson ( ) ) ; } }
Reads in the l5-swagger configuration and appends security settings to documentation.

@param string $filename The path to the generated json documentation
Reads in the l5 - swagger configuration and appends security settings to documentation .