I have a route like this:
Route::get('/s', 'DashboardController@search');
A super simple function to open a view like this:
public function search() {
return view('search');
}
And a form like this:
<form action="/s" method="get">
<input type="text" name="location" placeholder="Where" required>
<input type="text" id="checkin" placeholder="Check in" class="datepicker" required>
<input type="text" id="checkout" placeholder="Check out" class="datepicker" required>
<input type="submit" value="search now">
</form>
At the moment it sends the parameters through happily with the url like so:
http://localhost/s?location=Location%2C+Name%2C+Here&checkin=21-03-2016&checkout=22-03-2016
However, what I would really, really like to see in my URL is the following:
http://localhost/s/Location_Name_Here?checkin=21-03-2016&checkout=22-03-2016
Now I'm aware that I will have to modify the location myself to get it to read n a pretty manner like that. But how would I make it so that I end up using the location which is a parameter in the form, as a route, whilst still successfully passing the check in and check out parameters to the page in the traditional GET= fashion? I really want to keep that. I know I can do away with it entirely and just manipulate on the back end, but I'd rather not.
Thanks!