領収証発行サービス
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
394B

  1. <?php
  2. namespace App\Files;
  3. class Image
  4. {
  5. protected string $binary;
  6. protected string $mimetype;
  7. public function __construct(BaseFile $file)
  8. {
  9. $this->binary = $file->get();
  10. $this->mimetype = $file->getMimetype();
  11. }
  12. public function __toString()
  13. {
  14. return sprintf("data:%s;base64,%s", $this->mimetype, base64_encode($this->binary));
  15. }
  16. }