1. Go to this page and download the library: Download xerxes/s3-move library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// In your EventServiceProvider
protected $listen = [
\Xerxes\S3Move\Events\S3MigrationCompleted::class => [
YourListener::class,
],
];
// YourListener.php
public function handle(S3MigrationCompleted $event)
{
// $event->migratedFiles contains the collection of migrated files
foreach ($event->migratedFiles as $file) {
// Update database records, clean up, etc.
}
}