I\'m writing code in Laravel 5 to periodically backup a MySQL database. My code thus far looks like this:
$filename = \'database_backup_\'.date(\'G_a_m_d_y\
There is a way to copy files without needing to load the file contents into memory.
You will also need to import the following:
use League\Flysystem\MountManager;
Now you can copy the file like so:
$mountManager = new MountManager([
's3' => \Storage::disk('s3')->getDriver(),
'local' => \Storage::disk('local')->getDriver(),
]);
$mountManager->copy('s3://path/to/file.txt', 'local://path/to/output/file.txt');