You cannot change request routes in a filter because filters are applied AFTER the route is resolved.
One way would be to define a route like this:
Route::get('/{$request}', ' PagesController@slugRedirect ');
Then inside slugRedirect you search on redis, then call (or redirect from 301) the correct controller as follows:
I have not tested this, please let me know if it works or not.
source share