I want to edit a record using its id and I have the following code in my view:
<a href="{{route('guest.edit',$g->id)}}" class="btn btn-simple btn-warning btn-icon edit"><i class="ti-pencil-alt"></i></a>
And so I have on my route:
Route::resource('guest','GuestController');
Then on my controller:
public function edit($id){
$guest=Guest::find($id);
return view('Guests.edit1',compact('guest'));
}
The problem with this is that the id appears on my route, which I think is not safe, appears like this
http://localhost:8081/guest/2/edit
How do I fix it in such a way that the id is not shown in the url, or the url is not displayed at all