How to make header and footer fixed in Laravel DOMPDF when the content spans multiple pages?

I’m using the dompdf/dompdf package in my Laravel 9.52 application to convert HTML content into a PDF. My problem is that when the content of the PDF spans more than one page, I want the header and footer to stay fixed on every page.

Currently, the header and footer appear only on the first page, and they do not repeat or stay fixed on subsequent pages when the content overflows. How can I make the header and footer repeat on every page or stay fixed when the PDF spans multiple pages?

Here’s a simplified version of my code for generating the PDF:

use DompdfDompdf;
use DompdfOptions;

public function generatePdf()
{
    $dompdf = new Dompdf();
    $options = new Options();
    $options->set('isHtml5ParserEnabled', true);
    $options->set('isPhpEnabled', true);
    $dompdf->setOptions($options);

    $html = view('pdf.template', compact('data'))->render();
    $dompdf->loadHtml($html);
    $dompdf->render();
    $dompdf->stream('document.pdf');
}

i did try this :
=>Used position: fixed for the header and footer.
=>Tried adding padding/margins to prevent content from overlapping with the header and footer.