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

[8.x] Allowing skipping TransformRequests middleware via Closure #36856

Merged
merged 2 commits into from
Apr 2, 2021

Conversation

taylorotwell
Copy link
Member

@taylorotwell taylorotwell commented Apr 2, 2021

Currently, Livewire has to do some nasty hacking to skip these middleware on certain requests and the approach is not suitable for use with Octane. Adding this feature will allow Livewire and other libraries to register a callback with this base middleware during the framework's boot process to determine if the middleware should be skipped. That callback will receive the current request on each invocation.

TrimStrings::skipWhen(fn ($request) => shouldBeSkipped($request));
ConvertEmptyStringsToNull::skipWhen(fn ($request) => shouldBeSkipped($request));

@taylorotwell taylorotwell merged commit f05f390 into 8.x Apr 2, 2021
@taylorotwell taylorotwell deleted the skip-when branch April 2, 2021 16:08
@GrahamCampbell GrahamCampbell changed the title Allowing skipping TransformRequests middleware via Closure [8.x] Allowing skipping TransformRequests middleware via Closure Apr 2, 2021
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