Submission form
<form action="{{route('psm.pengurusan-staf.store')}}" method="POST">
@csrf
<div class="form-group">
<label>{{__('psm::general.passport')}}</label>
<input class="form-control" name="passport" value="{{$profiles->passport ?? null}}">
</div>
<div class="form-group">
<label>{{__('psm::general.nric')}}</label>
<input class="form-control" name="mykad" value="{{$profiles->mykad ?? null}}">
</div>
<div class="form-group">
<label>{{__('psm::general.fullName')}}</label>
<input type="text" class="form-control" name="name" value="{{$profiles->name ?? null}}">
</div>
</form>
Controller
public function show($id)
{
$profiles = profiles::where('user_id', $id)->first();
return view('psm::pengurusan-staf.show');
}
Route
Route::get('psm/pengurusan-staf/show/{id}', 'PengurusanStafController@show')
->name('psm.pengurusan-staf.show');
I'm using Laragon for the database. This is what I want the data to show.
show.blade.php
<div class="form-group">
<label>{{__('psm::general.passport')}}</label>
<li>{{$profiles->passport ?? null}}</li>
</div>
<div class="form-group">
<label>{{__('psm::general.nric')}}</label>
<li>{{$profiles->mykad ?? null}}</li>
</div>
<div class="form-group">
<label>{{__('psm::general.fullName')}}</label>
<li>{{$profiles->name ?? null}}</li>
</div>
Should I write the form for the route? For example, in theshow.blade.php, do I need to make the...
<form action="{{route('psm.pengurusan-staf.show')}}" method="POST"> @csrf @method('get') //my show.blade.php </form?