I want to redirect a page which consists of 'add new' form to another page with tabs. I want to specific tab to be activated when it returning to the page. However, I have problems in viewing the page because there is {id} value in the page url. This is the route of the redirect page to be viewed after submitting the form:
Route::get('/view_profil/{id}', 'Modul\ProfilController@show')->name('viewProfil');
I had put this code to redirect in the controller:
return redirect()->route('viewProfil', [$id})->withInput(['tab'=>'keluarga']);
I also tried this:
return redirect()->route('viewProfil')->withInput(['tab'=>'keluarga', 'id'=>$id]);
But both of them fail to get the right url to view the page
This is some sample from 'add new' form:
{!! Form::open(['method' => 'POST', 'action' => ['Modul\KeluargaController@store', $id]]) !!}
@if(Auth::check())
@if(count($dataItemregistration) > 0)
@foreach($dataItemregistration as $valueItemregistration)
<div class="form-group">
<div class="row">
<div class="col-lg-3">
</div>
<div class="col-lg-7">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-7">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-3">
</div>
<div class="col-lg-7">
</div>
</div>
</div>
@endif
@if(Auth::guest())
<a href="/login" class="btn btn-info"> Anda perlu log masuk.</a>
@endif
<div class="col-lg-10 text-center">
{!! Form::close() !!}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire