I'm trying to copy all folders (Agents & Blogs) from a source to a destination but the final result keeps creating a folder with the same name as my destination.
$src= storage_path('files/images/');
$dst=public_path('images/');
$command = 'cp -a ' . $src . ' ' .$dst;
$shell_result_output = shell_exec(escapeshellcmd($command));
The result of this creates a folder called images within images (public/images/images/->agents -> blogs). But I want it to be (public/images/->agents -> blogs). I even tried:
$dst=public_path('');
as well but I get the error:
cp: cannot create directory '/var/www/api/webapp/public/images/agents': Device or resource busy
PS: I'm doing all this in a laravel seeder file
via Hirad Roshandel