Answers for "Copy file from one directory to another Laravel"

PHP
0

Copy file from one directory to another Laravel

//Copy image using file facade laravel
$url = $data['featured_image'];
$imageName = substr($url, strrpos($url, '/') + 1);
$selected_file = str_replace(\URL::to('/'),'',$url);
\File::copy(public_path().'/'.$selected_file, public_path().'/storage/images/pages/'.$imageName.'');
Posted by: Guest on September-03-2021

Code answers related to "Copy file from one directory to another Laravel"

Browse Popular Code Answers by Language