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

Add hasMiddlewareGroup and getMiddlewareGroups methods #1

Merged
merged 1 commit into from
Jan 26, 2017

Conversation

MikeMnD
Copy link
Owner

@MikeMnD MikeMnD commented Jan 26, 2017

Handy method to be used when you want to register Middleware from a ServiceProvider and use:
prependMiddlewareToGroup
pushMiddlewareToGroup
Because they gracefully fail to add a middleware if a group is not existing first.
Also you can use:
middlewareGroup($name, array $middleware)
but still you can't be sure if you are overwriting an existing group ... since there is no way to check if the group already exist.
Also adding getMiddlewareGroups method just for convenience if you want to check multiple groups or do something in a foreach loop.

Handy method to be used when you want to register Middleware from a ServiceProvider and use: 
prependMiddlewareToGroup
pushMiddlewareToGroup
Because they gracefully fail to add a middleware if a group is not existing first.
Also you can use:
middlewareGroup($name, array $middleware)
but still you can't be sure if you are overwriting an existing group ... since there is no way to check if the group already exist.
Also adding getMiddlewareGroups method just for convenience if you want to check multiple groups or do something in a foreach loop.
@MikeMnD MikeMnD merged commit afb7bb8 into 5.4 Jan 26, 2017
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.

1 participant