Al momento de subir nuestro proyecto a un hosting compartido nos genera el error Cannot resolve public path trabajando con Laravel y domPDF, esto es un error en base a rutas de carpetas, para solucionarlo nos vamos a:
/vendor/barryvdh/laravel-dompdf/src/ServiceProvider.php
Y reemplazamos esto
$this->app->bind('dompdf', function ($app) { $options = $app->make('dompdf.options'); $dompdf = new Dompdf($options); $path = realpath($app['config']->get('dompdf.public_path') ?: base_path('public')); if ($path === false) { throw new \RuntimeException('Cannot resolve public path'); } $dompdf->setBasePath($path); return $dompdf; });
$this->app->bind('dompdf', function ($app) { $options = $app->make('dompdf.options'); $dompdf = new Dompdf($options); $path = realpath(base_path('')); if ($path === false) { throw new \RuntimeException('Cannot resolve public path'); } $dompdf->setBasePath($path); return $dompdf; });
Etiquetas:
Gusto por las motos Harley Davidson, el rock n roll y la informática, creador de este blog para difusión del conocimiento libre, interesado en el mundo open source.
Como editar las rutas de autenticacion en Laravel Jetsream
Configurar interfaces Fortigate, VPN IPSEC Telmex Infinitum
How to config Enlace Punto a punto con antenas Ubiquiti
Ubuntu server + squid proxy server + dhcp + 2 tarjetas de red
FrontEnd | Angular | BackEnd | Laravel | Envia Emails
Como crear un NavBar y SideNav menu Responsive en Angular