I have an app that search for places in citys.
I have this route
Route::get('s/{where}/{places}', 'SearchController@places')->name('search');
The SearchController
class SearchController extends Controller{
public function places(Request $request, $where, $places)
{
$where = $request->where;
if($places == 'places'){
return view('search.places', ['where' => $where]);
}else{
abort('404');
}
}
}
I also have tried with
->with()
The form submission to search
<form action="{{ route('search' , ['where', 'places']) }}" method="get">
I am getting something like this:
http://localhost/s/where/places?where=Paris
What i want is
http://localhost/s/paris/places
when it shoul replace the where in the url and not add where after the question mark!
Thanks for help
question from:
https://stackoverflow.com/questions/65849331/dynamic-url-laravel 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…