Create image from base64 string laravel

2024-04-20 07:19:21 Ashish Laravel

Simple function to Upload a Base 64 image in Laravel

public function createImageFromBase64(Request $request){
      $file_data       = $request->input('company_logo');
      //generating unique file name;
      $file_name = 'image_'.time().'.png';
      @list($type, $file_data) = explode(';', $file_data);
        @list(, $file_data)      = explode(',', $file_data);
     		// storing image in storage/app/public Folder


This post is submitted by one of our members. You may submit a new post here.

Related Tricks