I want to store my images in database as a blob. not as a file path . How can I do that? I use Laravel .
Advertisement
Answer
This might do the job.
$path = $request->file('file')->getRealPath(); $logo = file_get_contents($path); $base64 = base64_encode($logo); $account->logo = $base64; $account->save();