i folgenden Code habenLaravel Get Form
In View
<form method="get" action="{{url('/submit-model')}}" class="form-horizontal form-label-left" id="">
<input name="_token" type="hidden" value="{!! csrf_token() !!}" />
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12">Select Brand</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select id="select_brand" class="select_brand form-control show-tick" data-live-search="true" name="brand_name">
@foreach($brandList as $key=>$val)
<option value="{{$val->id}}" >{{$val->brand_name}}-{{$val->id}}</option>
@endforeach
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12">Select Model</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select id="select_model" class="select_model show-tick form-control" data-live-search="true" name="model_name" >
</select>
</div>
</div>
<!-- <div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12">Select Model</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="brand_name" class="form-control col-md-7 col-xs-12"
name="brand_name" id="brand_name"
placeholder="Brand Name e.g Nokia" type="text" value="">
</select>
</div>
</div>--->
<div class="form-group">
<div class="col-md-6 col-md-offset-3">
<button id="send" type="submit" class="btn btn-success">Search</button>
</div>
</div>
</form>
In Route
Route::get('mobiteam/submit-model/', '[email protected]');
Kontroller
public function submitModel(Request $request){
print_r($request->all());
}
Meine Frage ist
wie i get Form mit benutzerfreundlichen URL wie
Strecke :: get ('/ submit-Modell/{herstellername}/{} modelname', 'MobiTeamController @ submitModel') einreichen können;
statt
http://localhost/project/public/submit-model?_token=4LsaeqXbsjWLYf199LtSr7EgLacxhncNKde9Zpy2&brand_name=39&model_name=21
In Ajax ich kann, aber ich versuche, ohne Ajax
Verwenden Sie 'POST' anstelle von' GET'? –
wenn ich benutze post-benutzer kann nicht zur vorherigen url – vision