Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create controller to handle closure routes endpoints #19

Merged
merged 2 commits into from
Apr 19, 2016
Merged

Create controller to handle closure routes endpoints #19

merged 2 commits into from
Apr 19, 2016

Conversation

bbs-smuller
Copy link
Contributor

Hello,

I submit this pull request for 2 reasons :

  • Route caching (closure routes cannot be cached)
  • Override routes in main routes file

In some of my projects I use your library to get benefit from the nice Swagger Interface.
My frontend is handled by an Angular app (one single Laravel route) like

Route::get('/{one?}/{two?}', 'HomeController@index')

And this route even at the end of my app routes.php file override the ones declared by your package. With a Controller I'm able to override the package routes declaration with :

// Swagger
Route::any(config('l5-swagger.routes.docs') . '/{page?}', '\L5Swagger\Http\Controllers\SwaggerController@docs');
Route::get(config('l5-swagger.routes.api'), '\L5Swagger\Http\Controllers\SwaggerController@api');

// Homepage
Route::get('/{one?}/{two?}', 'Front\HomeController@getIndex');

Thanks for your work, I'm available if you have any question.

@DarkaOnLine
Copy link
Owner

Hi, @bbs-smuller

Everything looks OK form me. Nice job. Thank's

@DarkaOnLine DarkaOnLine merged commit 92feca3 into DarkaOnLine:master Apr 19, 2016
@pewla
Copy link

pewla commented Jun 16, 2016

Hi @bbs-smuller ...that is a great piece of magic you've done there. I can do with some help here. I am fairly new to laravel so please help me out a bit. I have set up the swagger version 2 in my project (laravel 5.1) but the swagger ui only works when i run internal server (i.e php artisan serve). After seeing your controllers i want to implement them in my project so i can run swagger ui in my apache server. So i want to know what exactly in you put inside the docs fundtion in the SwaggerController. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants