I have a route that looks like this:
Route::namespace('Api\HelpGuides')->prefix('help')->group(function () {
Route::get('/{userInput}', 'FetchArticlesController')
->where('userInput', '.*');
});
And the controller that looks like this:
public function __invoke(Request $request, string $userInput) ...
I want to be able to capture the $userInput so if I receive a request from the front-end that is like:
/api/help/anything/could/be/in/here?including=params
That I can consume in the FetchArticlesController.
When I dump out $userInput in my controller, I am given everything up to the query string, so in the above example, it dumps out
/anything/could/be/in/here
Is there a way I can make it dump out everything after my defined route? e.g. ANYTHING after /api/help/
? I would ideally like that $userInput string to look like:
/anything/could/be/in/here?including=params