I am trying to move a file from one place to another. In this case, my user profile picture. Since I store the user profile database on my own username, therefore, when they change them username. I will need to move the photo of my profile, otherwise the link to the image will be broken.
I tried here here
if ( $user->username != Input::get('username')){
$new_path = public_path().'/img/logo/'. Input::get('username').'/'.$user->logo_path;
$old_path = public_path().'/img/logo/'. $user->username.'/'.$user->logo_path;
$move = File::move($new_path, $old_path);
$delete = File::delete($old_path);
}
I kept getting

Any suggestions for me?
source
share