Skip to content

Commit

Permalink
Enable file save in render method (#21)
Browse files Browse the repository at this point in the history
* Enable file save in render method

* delete extra semicolon

* Simplify method's params
  • Loading branch information
Ahmed Yaseen authored Nov 4, 2022
1 parent 69b3dd3 commit e8f53ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/GenerateQrCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ public function toBase64(): string
* Render the QR code as base64 data image.
*
* @param array $options The list of options for QROption (https://github.com/chillerlan/php-qrcode)
* @param string|null $file File string represent file path,name and extension
*
* @return string
*/
public function render(array $options = []): string
public function render(array $options = [], string $file = null): string
{
$options = new QROptions($options);
return (new QRCode($options))->render($this->toBase64());
return (new QRCode($options))->render($this->toBase64(), $file);
}
}

0 comments on commit e8f53ce

Please sign in to comment.