To override this configuration on a per-file basis use the fourth parameter of the initializing call like this: PDF::loadView('pdf', $data,, [ 'keywords' => 'PDF, Laravel, Package, Peace', // Separate values with comma 'subject' => 'This Document will explain the whole universe.', If you have published config file, you can change the default settings in config/pdf.php file: return [ Stream($filename): Return a response with the PDF to show in the browser. It is also possible to use the following methods on the pdf object:Äownload($filename): Make the PDF downloadable by the user. $pdf = PDF::loadView('pdf.document', $data) You can pass data to a view in /resources/views. To use Laravel PDF add something like this to one of your controllers. Now, you should publish package's config file to your config directory by using following command: php artisan vendor:publish 'PDF' => niklasravnsborg\LaravelPdf\Facades\Pdf::class ![]() Niklasravnsborg\LaravelPdf\PdfServiceProvider::class To start using Laravel, add the Service Provider and the Facade to your config/app.php: 'providers' => [ Note: This package supports auto-discovery features of Laravel 5.5+, You only need to manually add the service provider and alias if working on Laravel version lower then 5.5 ![]() Require this package in your composer.json or install it by running: composer require niklasravnsborg/laravel-pdf Easily generate PDF documents from HTML right inside of Laravel using this mPDF wrapper.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |