DarkaOnLine/SwaggerLume

SwaggerLumeController@api loads view from default path instead of configured path

Closed this issue · 0 comments

I have edited the value of the 'paths.views' key from the 'config/swagger-lume.php' file.

<?php
return [
    //...
    'paths' => [
        'views' => base_path('resources/views/documentation/api'),
    ],
]

When I launch the artisan command "swagger-lume:publish-views", the "index.blade.php" is created on the path that i have configured.

However, when i access the route of the swagger-ui, the template rendered is not my template but the default template from the package. I figured that out because i have added some code to my template.

After inspecting the code from your package, I found that the method SwaggerLumeController@api uses the scope resolution operator to load the swagger-ui template.

view('swagger-lume::index', [

For the moment, I have made a workaround consisting o creating a second 'index.blade.php' in the path 'resources/views/vendor/swagger-lume' where I include my custom template.

@include("documentation.api.index")

But, it would be better if the controller loads the template from the configured path in the 'config/swagger-lume.php'.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.