LARAVEL 5.1
I want to edit my table which having ID and TktID.
I want to pass this two parameters to edit method of my TestController.
My link:
<a href="/sig/edit?id={{$value->id}}&ticketid={{$value->ticketid}}" title="Edit signature">
My route.php
Route::get('sig/edit{id}{ticketid}','TicketsController@edit');
edit method of controller:
public function edit($id, $ticketid)
{
//
}
How do I pass here two arguments in route.php to controller.
You forget end bracket
You have error in your routes.php file:
Route::get('sig/edit{id}{ticketid}', 'TicketsController@edit');
Should be:
Route::get('sig/edit/{id}/{ticketid}', 'TicketsController@edit');
Notice the forward slash after edit and id.
And in the view it should be either of the following:
<a href="{{ url('sig/edit/ ' . $value->id . '/' . $value->ticketid .')}}" title="Edit signature">
Or
<a href="/sig/edit/{$value->id}/{$value->ticketid}" title="Edit signature">
I hope this helps you out. Cheers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With