S3 filesystem driver — stores files in Amazon S3 or any S3-compatible service with URL generation and pre-signed URLs.
composer require marko/filesystem-s3This automatically installs marko/filesystem and aws/aws-sdk-php.
use Marko\Filesystem\Manager\FilesystemManager;
class MediaService
{
public function __construct(
private FilesystemManager $filesystemManager,
) {}
public function upload(string $path, string $contents): void
{
$this->filesystemManager->disk('s3')->write($path, $contents);
}
}Full usage, API reference, and examples: marko/filesystem-s3