add shipping rules
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
namespace App\Repositories\Core;
|
||||
|
||||
use Barryvdh\DomPDF\Facade\Pdf as DomPDF;
|
||||
use Barryvdh\Snappy\Facades\SnappyPdf;
|
||||
use GravityMedia\Ghostscript\Ghostscript;
|
||||
use Mpdf\Mpdf;
|
||||
use Barryvdh\Snappy\Facades\SnappyPdf;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
class PDF
|
||||
@@ -18,15 +18,13 @@ class PDF
|
||||
->waitUntilNetworkIdle()
|
||||
->format('A4')
|
||||
->showBackground()
|
||||
->savePdf("temp.pdf");
|
||||
|
||||
->savePdf('temp.pdf');
|
||||
|
||||
$postRoute = URL::signedRoute('orderinvoices.store', ['order' => $this->order]);
|
||||
Http::attach('invoice', file_get_contents('temp.pdf'), $filename)
|
||||
->post($postRoute)
|
||||
->throw();
|
||||
}
|
||||
catch (\Exception $exception )
|
||||
{
|
||||
} catch (\Exception $exception) {
|
||||
Log::error($exception);
|
||||
}
|
||||
}
|
||||
@@ -35,6 +33,7 @@ class PDF
|
||||
{
|
||||
\Debugbar::disable();
|
||||
$pdf = DomPDF::loadView($view, $data);
|
||||
|
||||
return $pdf->download($filename);
|
||||
}
|
||||
|
||||
@@ -42,12 +41,14 @@ class PDF
|
||||
{
|
||||
$mpdf = new Mpdf();
|
||||
$mpdf->WriteHTML($html);
|
||||
|
||||
return $mpdf->Output();
|
||||
}
|
||||
|
||||
public static function convertURL($url)
|
||||
{
|
||||
$pdf = SnappyPdf::loadFile($url);
|
||||
|
||||
return $pdf->download('invoice.pdf');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user