I am running a php laravel program with laravel v 10 and php 8.1.2 which is supposed to create a pdf document. I have no problem when running the program in localhost but I am getting this issue after the system is hosted in shared hosting with a cPanel.
protected function passedValidation()
{
Pdf::loadView('quotation.quotationpdf', [
'taxes' => $this->taxes,
'force_majuere' => $this->force_majuere,
])->save(storage_path('app/public/quotations/quotation.pdf'));
}
This is my code and error is being shown in 'force_majuere' => $this->force_majuere,
this line.
I have searched the internet and my problem is close to this question but there is no answers or solution provided. Some other solutions I have found are to upgrade php to 8.2 but it is not possible as php 8.2 is not supported by my server. I have tested my program in php 8.1.2 and php 8.2 in local environment but my remote server is using php 8.1.21 could this be the issue, or issue lies in laravel-dompdf which I am using version 2.0.1.