i have a bill blade in laravel. i need to print that bill in a particular network printer.Now i use dompdf for stream() but doesnot print . and i have no idea for connecting a printer in the section
<script>
$(document).ready(function() {
$( "#Kitchen" ).click(function(e) {
var orderid = $(e.currentTarget).attr('data-id');
$.ajax({
type: 'POST',
url:"{{url('Send-Order-to-Kitchen')}}/"+orderid,
data:{
"_token": "{{ csrf_token() }}",
},
success: function (data) {
// console.log(data);
toastr.options = {
"closeButton": true,
"newestOnTop": true,
"positionClass": "toast-top-right"
};
toastr.success(data.msg);
},
error: function (xhr) {
if (xhr.status == 401) {
window.location.href = "{{url('staff/login')}}";
}else if(xhr.status == 200){
window.location.href = "{{url('staff/login')}}";
}
}
});
});
});
</script>
public function Sendordertokitchen($id){
set_time_limit(180);
Order::where('id',$id)->update(['status' => 1]);
$order = Order::find(22);
// return view('manager/kitchen_receipt',compact('order'));
$pdf = PDF::loadView('manager/kitchen_receipt', compact('order'));
$file = 'Kitchen_Print_'.$order->token_id.'.pdf';
return $pdf->download($file);
// return response()->json(['msg' => 'Order menus send to the kitchen successfully']);
}