Hi,
I hope the below code will help you..
if ($file = Input::file('pic'))
{
$fileName = $file->getClientOriginalName();
$extension = $file->getClientOriginalExtension() ?: 'png';
$folderName = '/uploads/users/';
$destinationPath = public_path() . $folderName;
$safeName = str_random(10).'.'.$extension;
$file->move($destinationPath, $safeName);
$user->pic = $safeName;
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community