I have this problem where i need to get this kind of url localhost:8000/purchaseOrder/3/purchase/1
if i typed it manually it worked but when i make the laravel automatically create the url it got error and end up with localhost:8000/purchaseOrder/$data-%3Eid/payable/$p-%3Eid
this are my routing
Route::get('/purchaseOrder/{id}/payable/{he}', 'AjaxController@purchaseOrder');
this are my controller (so far all i wanted is just respond to the url i gave)
function purchaseOrder($id,$he)
{
echo $id." | ".$he;
}
this are my view
<a href="{{ url('purchaseOrder/$data->id/payable/$p->id') }}"><button type="button" class="btn btn-success btn-sm my-1" name="button">Create Purchase Order</button></a><br>
change view code :
<a href="{{ url('purchaseOrder/'.$data->id.'/payable/'.$p->id.') }}"><button type="button" class="btn btn-success btn-sm my-1" name="button">Create Purchase Order</button></a><br>
another way is this:
set name for route
Route::get('/purchaseOrder/{id}/payable/{he}', 'AjaxController@purchaseOrder')->name('purchaseOrder');
and in view:
<a href="{{ route('purchaseOrder',[$data->id,$p->id]) }}">