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

Use variadic argument in Group::middleware(), Group::prependMiddleware() and similar methods #141

Closed
vjik opened this issue Dec 25, 2021 · 2 comments
Labels
status:ready for adoption Feel free to implement this issue.

Comments

@vjik
Copy link
Member

vjik commented Dec 25, 2021

  • Group::middleware()
  • Group::prependMiddleware()
  • Route::middleware()
  • Route::prependMiddleware()
  • RouteCollector::middleware()
  • RouteCollector::prependMiddleware()
@samdark
Copy link
Member

samdark commented Dec 25, 2021

Currently the syntax is:

Route::get('/api/bla-bla')
  ->middleware(Authenticate::class)
  ->middleware(FormatDataResponseAsHtml::class)

I'm not sure the following will be better:

Route::get('/api/bla-bla')
  ->middleware(
    Authenticate::class,
    FormatDataResponseAsHtml::class
  )

@vjik
Copy link
Member Author

vjik commented Dec 26, 2021

Current syntax will remain available. Variadic is optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue.
Projects
None yet
Development

No branches or pull requests

2 participants