I am having trouble to understand how to change a get Route with a dynamic parameter in Laravel. I have a route that dynamically adds company names as route parameters, something along the lines of www.page.com/{name_of_company}
In my web.php, the route looks like this:
Route::get('/{company_name}', ['uses' => 'Frontend\CompanyController@show', 'as' => 'CompanyShow']);
I now need to change the {company_name} variable though, for example to remove whitespace, change certain characters etc. so I was planning to use some sort of str_replace function, I just need to know where I have to apply this function to the dynamic parameter so that it gets successfully called with the newly "cleaned" name version in the URL. I tried to directly manipulate the dynamic variable inside of the get route and I also tried to use middleware, but I didn't know how to do it in the end, so I am asking the question here and hope someone has an idea on how to accomplish this ...