Search
 
SCRIPT & CODE EXAMPLE
 

PHP

convert image to base64 in laravel

$image = base64_encode(file_get_contents($request->file('image')->path()));
Comment

laravel upload base64 image

$image = $request->image;  // your base64 encoded
        $image = str_replace('data:image/png;base64,', '', $image);
        $image = str_replace(' ', '+', $image);
        $imageName = str_random(10).'.'.'png';
        File::put(storage_path(). '/' . $imageName, base64_decode($image));
Comment

PREVIOUS NEXT
Code Example
Php :: php serialize array 
Php :: check which database connect laravel 
Php :: minus day from carbon date 
Php :: laravel validator make custom message 
Php :: how to use where relationship laravel 
Php :: associative array sorting by value in php 
Php :: php replace blackslash 
Php :: get value from json laravel 
Php :: Deleting an element from an array in PHP 
Php :: Laravel Error Log, How to check Error Log in Laravel 
Php :: php file upload error 
Php :: laravel set config value dynamically 
Php :: php loop object 
Php :: php convert object to array nested 
Php :: populate old value of dropdown laravel 
Php :: acf repeater 
Php :: php date object to timestamp 
Php :: how delete the table in laravel in the commend 
Php :: laravel query latest 
Php :: php cloudflare get country from IP 
Php :: How do I get the current date and time in PHP? 
Php :: laravel foreach iteration 
Php :: laravel launch only one dusk test 
Php :: php date + 30 days 
Php :: allowed memory size of bytes exhausted composer 
Php :: File Reading Modes PHP 
Php :: how to check php version codeigniter 3 
Php :: php array filter 
Php :: php session destroy 
Php :: php call class dynamically 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =