From e0c33f23e2b696a1d11a2b1408781b961b86fde4 Mon Sep 17 00:00:00 2001 From: Ale Date: Sat, 27 Nov 2021 11:23:12 -0300 Subject: [PATCH] Se pasa info al mpdf --- app/Http/Controllers/LibrilladoraController.php | 3 ++- app/Models/Librilladora.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/LibrilladoraController.php b/app/Http/Controllers/LibrilladoraController.php index 0db22e5..d5650b9 100644 --- a/app/Http/Controllers/LibrilladoraController.php +++ b/app/Http/Controllers/LibrilladoraController.php @@ -9,7 +9,8 @@ class LibrilladoraController extends Controller { // public function process(Request $request) { + $nombre = $request->input("Archivo"); $lib = new Librilladora(); - $lib->prueba(); + $lib->prueba($nombre); } } diff --git a/app/Models/Librilladora.php b/app/Models/Librilladora.php index f1fc0e6..6baf4be 100644 --- a/app/Models/Librilladora.php +++ b/app/Models/Librilladora.php @@ -8,11 +8,11 @@ use Illuminate\Database\Eloquent\Model; class Librilladora extends Model { use HasFactory; - public function prueba() { + public function prueba(string $nombre) { $mpdf = new \Mpdf\Mpdf(); // Write some HTML code: - $mpdf->WriteHTML('Hello World'); + $mpdf->WriteHTML($nombre); // Output a PDF file directly to the browser $mpdf->Output();