Route: process through a controller and redirect

I want to define a route that does the following:

  1. Takes the route (URL) parameters and saves them to the database (for analytics/logging purposes)
  2. Then redirects to a new link, using some, or all, of the original URL parameters.

Possible? Any short example of this?


If you want to apply to more than one route, a Middleware is what you want to capture the route data.

No doc on this, but here’s an example of a middleware :