Level 39
blob is a MySql/MariaDB storage type
base64 decode is a string type
You can insert directly insert a string type in a blob type
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Any Option available in Laravel to convert base64decode to blob??
https://www.php.net/manual/en/function.base64-decode.php
https://laravel.com/docs/8.x/database#running-an-insert-statement
$str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==';
$str_decode= base64_decode($str);
// This is an encoded string
DB::insert('insert into my_table (my_blob_field) values (?)', [$str_decode']);
Please or to participate in this conversation.