バイナリデータで取得した画像をブラウザに表示する-PHP

サーバー側

<?php
$url = 'https://example.com/image/example.jpg';
$fileObject= file_get_contents($url);
$encodeImage = base64_encode($fileObject);
$imageInfo =  getimagesize('data:application/octet-stream;base64,' . $encodeImage);
$imageSource = 'data:' . $imageInfo['mime'] . ';base64,' . $encodeImage;

フロント側

<img src="{{ $imageSource }}">