You can use string placeholders for javascript.
<input type="hidden" id="_room_id" value="{{ $room->id }}">
<input type="hidden" id="_room_project_id" value="{{ $room->id_project }}">
let project_id = $('#_room_project_id').val(); // or document.getElementById('_room_project_id').value if you're not using JQuery
let id = $('#_room_id').val(); // or document.getElementById('_room_id').value if you're not using JQuery
let url = "{{ route('datatable.getaccess', [':project_id', ':id']) }}".replace(':project_id', project_id).replace(':id', id);
This looks wrong but it works since we're passing strings to the route helper (which in turn produces a string)
route('datatable.getaccess', [':project_id', ':id'])
// 'viewroom/:project_id/:id'
so
let url = "{{ route('datatable.getaccess', [':project_id', ':id']) }}".replace(':project_id', project_id).replace(':id', id);
is equivalent to
let url = "viewroom/:project_id/:id".replace(':project_id', project_id).replace(':id', id);
web.phproutes file?routeis having oneroute parameterand other value is appended asquery parameterRoute::get('viewroom/{id_project}/{id}', 'RoomController@show');like thatroute name? It should be like thisRoute::get('viewroom/{id_project}/{id}', 'RoomController@show')->name('datatable.getaccess');