Я создал опцию автоматической генерации счета-фактуры в моем приложении laravel, используя dompdf, он нормально работает в моем локальном p c, но на моем сервере его ошибка ниже в моем файле журнала и очереди заданий также не удалась. Я добавляю pdf generate option в файл очереди заданий, он выглядит так хорошо на моем localhost
[2020-03-17 11:09:00] production.ERROR: Class 'Dompdf\Cpdf' not found {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'Dompdf\\Cpdf' not found at /var/www/html/panaroma-services/vendor/dompdf/dompdf/src/Adapter/CPDF.php:198)
[stacktrace]
#0 /var/www/html/panaroma-services/vendor/dompdf/dompdf/src/CanvasFactory.php(57): Dompdf\\Adapter\\CPDF->__construct('a4', 'portrait', Object(Dompdf\\Dompdf))
#1 /var/www/html/panaroma-services/vendor/dompdf/dompdf/src/Dompdf.php(300): Dompdf\\CanvasFactory::get_instance(Object(Dompdf\\Dompdf), 'a4', 'portrait')
#2 /var/www/html/panaroma-services/vendor/barryvdh/laravel-dompdf/src/ServiceProvider.php(50): Dompdf\\Dompdf->__construct(Array)
#3 /var/www/html/panaroma-services/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Barryvdh\\DomPDF\\ServiceProvider->Barryvdh\\DomPDF\\{closure}(Object(Illuminate\\Foundation\\Application), Array)
#4 /var/www/html/panaroma-services/vendor/laravel/framework/src/Illuminate/Container/Container.php(681): Illuminate\\Container\\Container->build(Object(Closure))
#5 /var/www/html/panaroma-services/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\\Container\\Container->resolve('dompdf', Array)
#6 /var/www/html/panaroma-services/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(776): Illuminate\\Container\\Container->make('dompdf', Array)
#7 /var/www/html/panaroma-services/vendor/laravel/framework/src/Illuminate/Container/Container.php(1245): Illuminate\\Foundation\\Application->make('dompdf')
#8 /var/www/html/panaroma-services/vendor/barryvdh/laravel-dompdf/src/ServiceProvider.php(58): Illuminate\\Container\\Container->offsetGet('dompdf')
#9 /var/www/html/panaroma-services/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Barryvdh\\DomPDF\\ServiceProvider->Barryvdh\\DomPDF\\{closure}(Object(Illuminate\\Foundation\\Application), Array)
#10 /var/www/html/panaroma-services/vendor/laravel/framework/src/Illuminate/Container/Container.php(681): Illuminate\\Container\\Container->build(Object(Closure))
#11 /var/www/html/panaroma-services/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\\Container\\Container->resolve('dompdf.wrapper', Array)
#12 /var/www/html/panaroma-services/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(776): Illuminate\\Container\\Container->make('dompdf.wrapper', Array)
#13 /var/www/html/panaroma-services/vendor/barryvdh/laravel-dompdf/src/Facade.php(20): Illuminate\\Foundation\\Application->make('dompdf.wrapper')
#14 /var/www/html/panaroma-services/app/Jobs/OrderCompleteJob.php(43): Barryvdh\\DomPDF\\Facade::__callStatic('loadView', Array)
#15 [internal function]: App\\Jobs\\OrderCompleteJob->handle()
public function handle()
{
$getOrderDtls = $this->pdf;
$pdf = PDF::loadView('order.pdf.invoice', compact('getOrderDtls'));
$order_no = str_pad($this->data['order_id'], 6, "0", STR_PAD_LEFT);
$path = public_path('pdf/invoice_pdf/');
// $path = url('pdf/invoice_pdf/');
$fileName = $order_no . '.' . 'pdf' ;
$pdf->save($path . '/' . $fileName);
$pdf->download($path . '/' . $fileName);
$pdf_file_path = $path . $fileName;
\Mail::send($this->template_name, $this->data, function($message) use($pdf_file_path) {
$message->to($this->email)->subject($this->subject)->attach($pdf_file_path);
});
}
, вот мой импорт
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use PDF;
Может кто-нибудь помочь ??