📜  在 pdf 中找不到图像或类型未知 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:59.940000             🧑  作者: Mango

代码示例1
public function pdf()
{
    $users = User::get();
    $pdf = PDF::loadView('pdf', compact('users'));
    $pdf->getDomPDF()->setHttpContext(
        stream_context_create([
            'ssl' => [
                'allow_self_signed'=> TRUE,
                'verify_peer' => FALSE,
                'verify_peer_name' => FALSE,
            ]
        ])
    );

    return $pdf->download('Users.pdf');
}