-
-
Notifications
You must be signed in to change notification settings - Fork 143
feat(router): add redirect back response #1050
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
feat(router): add redirect back response #1050
Conversation
|
The failing tests aren't related to this PR, I'll fix them before merging. One thing I was wondering about: how to set the |
|
I will look into it. it will take some time because its the first time doing something with temptest. |
|
I looked into the implementation of laravel:
Do we have a global Middleware which i can use? Some ideas, which feels wrong:
|
|
Currently global HTTP middleware is added here: https://github.com/tempestphp/tempest-framework/blob/main/src/Tempest/Router/src/RouterInitializer.php#L19 This will be refactored soon, but you can add it over there for now. |
Pull Request Test Coverage Report for Build 14191311957Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
Middleware has now been refactored. The difference is that middleware is discovered, so you won't need to add it anywhere anymore. Just make sure to add a priority like with this one: https://github.com/tempestphp/tempest-framework/blob/main/src/Tempest/Router/src/Cookie/SetCookieMiddleware.php#L13 |
|
I introduced a new middleware, only for the purpose of storing the previous url in the session. I borrowed two functions from laravel It is possible to remove the new functions from the session and use the new const Let me know if i should refactor PS: I did my best to figure out the right way to test. It is way harder then expected to contribute to the core of a framework ;) Thanks for your patience and help. |
|
Looking great! Thanks for sticking with it and figuring it out, I actually have nothing to add :) I'll let CI run and then merge it! Are you up for PRing the docs as well? A simple entry in this list should be fine: https://github.com/tempestphp/tempest-docs/blob/main/src/Web/Documentation/content/main/1-essentials/02-controllers.md?plain=1#L363 |
|
@brendt of course. tempestphp/tempest-docs#71 |
Fixes: #1049