I want to do a URL editing for SEO purposes. Data will be entered from the form. According to the filters entered;
simple URL: http://127.0.0.1:8000/query
When filtered data is listed, URL: http://127.0.0.1:8000/query/"input text value"/"city name"/"category name"
I want it to happen. How can I do it?
Blade form:
<form method="get" action="">
@Csrf
<div class="row align-items-center">
<div class="col-lg-12 col-xl-4 no-sm-border border-right">
<input type="text" name="what" class="form-control">
</div>
<div class="col-lg-12 col-xl-3 no-sm-border border-right">
<div class="wrap-icon">
<span class="icon icon-room"></span>
<select class="form-control" name="city_id" id="">
<option value="0">All</option>
@foreach(json_decode($cities) as $city)
<option value=""></option>
@endforeach
</select>
</div>
</div>
<div class="col-lg-12 col-xl-3">
<div class="select-wrap">
<span class="icon"><span class="icon-keyboard_arrow_down"></span></span>
<select class="form-control" name="category_id" id="">
<option value="0">All</option>
@foreach(json_decode($categories) as $category)
<option value=""></option>
@endforeach
</select>
</div>
</div>
<div class="col-lg-12 col-xl-2 ml-auto text-right">
<input type="submit" class="btn btn-primary" value="Search">
</div>
</div>
</form>
web.php
Route::get('/query', 'HomeController@query')->name('query');
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire