在Live Server中请求Ajax不';我不适合印刷

在Live Server中请求Ajax不';我不适合印刷,ajax,laravel,printing,Ajax,Laravel,Printing,我的出纳项目建立在拉雷维尔。我需要通过移动蓝牙从网络浏览器打印收据 我使用和包装 在localhost中运行时,我的程序运行正常。但是,在live server中不起作用 这是我的视图: <button onclick="ajax_print('{{url('/cashier/pay',[$id])}}',this)" class="btn btn-sm btn-warning">Pay </button> try{

我的出纳项目建立在拉雷维尔。我需要通过移动蓝牙从网络浏览器打印收据

我使用和包装

在localhost中运行时,我的程序运行正常。但是,在live server中不起作用

这是我的视图

<button
   onclick="ajax_print('{{url('/cashier/pay',[$id])}}',this)"
   class="btn btn-sm btn-warning">Pay
</button>
try{    
    $profile = CapabilityProfile::load("POS-5890");
    $connector = new RawbtPrintConnector();
    $printer = new Printer($connector, $profile);
        
    // Content
    $printer->setJustification(Printer::JUSTIFY_CENTER);
    $printer->selectPrintMode(Printer::MODE_DOUBLE_WIDTH);
    $printer->text("Hello World.\n");            
                    
    //Print
    $printer->cut();
    $printer->pulse();
  } catch (Exception $e) {
      return redirect()->route('cashierindex')->with('error','Something Error');
  } finally {
      $printer->close();
  }
这是我的控制器

<button
   onclick="ajax_print('{{url('/cashier/pay',[$id])}}',this)"
   class="btn btn-sm btn-warning">Pay
</button>
try{    
    $profile = CapabilityProfile::load("POS-5890");
    $connector = new RawbtPrintConnector();
    $printer = new Printer($connector, $profile);
        
    // Content
    $printer->setJustification(Printer::JUSTIFY_CENTER);
    $printer->selectPrintMode(Printer::MODE_DOUBLE_WIDTH);
    $printer->text("Hello World.\n");            
                    
    //Print
    $printer->cut();
    $printer->pulse();
  } catch (Exception $e) {
      return redirect()->route('cashierindex')->with('error','Something Error');
  } finally {
      $printer->close();
  }

您能帮助我吗,为什么这段代码在live server中不起作用,但在localhost中却可以正常工作?

我认为这是一个小问题


在中,您应该在服务器中激活需求php扩展。在我的例子中,我忘了激活intl扩展我想这是一个小小的问题


在mike42中,您必须启动对服务器的个人主页扩展的需求。在您的例子中,您忘记了激活所需的扩展

它在catch中抛出的是哪种类型的异常?