領収証発行サービス
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

23 行
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. }