public function generate(InvoiceInterface $invoice, $storagePath = '/tmp')
    {
        // To properly capture a screenshot of the invoice view, we will pipe out to
        // PhantomJS, which is a headless browser. We'll then capture a PNG image
        // of the webpage, which will produce a very faithful copy of the page.
        $viewPath = $this->writeViewForImaging($invoice, $storagePath);
        $this->getPhantomProcess($viewPath)
            ->setTimeout(10)->run();

        return $this->files->get($viewPath);
    }