Open kiranrs opened 1 year ago
I experienced the same issue, resolved by using the following code instead
<img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(100)->generate('My Data')) !!} ">
You need to convert the instance of HtmlString
into string
. I believe the return type of embedData
has changed since the writing of the docs.
You can use something like this:
{!!$message->embedData(QrCode::size(200)->format('png')->generate('MyData')->toHtml(),'QrCode.png','image/png')!!}
I've added the ->toHtml()
which will convert the HtmlString
instance into string
.
Hi, I'm facing this error after upgrading Laravel 8.65 to 9.52. It was working fine on Laravel 8 but afterupgrading to Laravel 9I'm getting this error.
The body of "Symfony\Component\Mime\Part\TextPart" must be a string, a resource, or an instance of "Symfony\Component\Mime\Part\File" (got "Illuminate\Support\HtmlString").
This my HTML Code
{!!$message->embedData(QrCode::size(200)->format('png')->generate('My Data'), 'QrCode.png', 'image/png')!!}