PHP code example of marifhasan / printpdf
1. Go to this page and download the library: Download marifhasan/printpdf library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
marifhasan / printpdf example snippets
use
Route::get('/{order:id}/print', [OrderController::class, 'print'])->name('print'); // order.print
use App\Models\Order;
use App\Prints\OrderPrint;
use Marifhasan\PrintPDF\PrintPDF;
/**
* Display the order print form.
*/
public function print(Order $order)
{
return PrintPDF::make(new OrderPrint($order))
->inline();
}
php artisan make:print OrderPrint