Closed realtebo closed 2 years ago
@mccarlosen thanks a bunch for this wrapper.
Could you help us pop the Macroable trait in the LaravelMpdfWrapper?
Hi guys!
Could you give me an example? How would you use it?
@mccarlosen
By adding the Macroable trait to the LaravelMpdf, we could extend the class with custom methods for our own use case.
For example, I may want to add a method that returns a base64 representation of the Pdf string.
LaravelMpdf::macro('base64', function () {
return base64_encode($this->output());
});
Then it could be used like so;
$base64_string = PDF::loadView('pdf.document', $data)->base64();
Thanks
Also, we can create a ::init to return a new instance with some defaults about security, etc
Hello guys!
The package has been updated to version 2.1.9.
Please, You may update your composer file and start using this new feature.
Hi !
As title, we ask you kindly to implement Macroable in this project so we can add macro instead of creating custom helpers as shortcut.