A Laravel Package for viewing PDF files or documents on Web App
This package is meant to help with viewing portable document file(PDF) on the web seamlessly when developing with Laravel. The package makes use of ViewerJS, (*2)
To install into your project, run the command below in your terminal., (*3)
composer require goodnesskay/laravelpdfviewer
Once the package is done being installed, register the service provider. Open config/app.php
and add the following to the providers
key., (*4)
Goodnesskay\LaravelPdfViewer\LaravelPdfViewerServiceProvider::class,
, (*5)
## Configure Run this in your terminal: ``` php artisan vendor:publish --provider="Goodnesskay\LaravelPdfViewer\LaravelPdfViewerServiceProvider", (*6)
It will publish a folder named `laraview` to the root folder of your project. ## How it Works Simple!!! After installations and configurations have been carried out successfully, add the code below to your html file ``` {{ asset('/laraview/#../folder-name/the-pdf-file.pdf') }}
It should look like this:, (*7)
Then, you should have something like this:, (*8)
, (*9)
Note:, (*10)
After
#../
in{{ asset('/laraview/#../folder-name/the-pdf-file.pdf') }}
, what should follow is the folder name of the pdf files in the public folder then, the pdf file name can follow., (*11)
You can fork
this package, contribute
and submit a pull request
. I will really love it., (*12)
You can appreciate me by starring this repository and follow me on Github , twitter and subscribe to my Youtube Channel!, (*13)
I love you like mad., (*14)
Goodness Kayode | Pusher of Codes, (*15)
MIT License (MIT)., (*16)