'Laravel how to upload/download files to Amazon S2 using KMS

I am trying to upload/download files from amazon s3 using KMS, although i have implemented this without using KMS by the following code,

$filePath = "users/" . $user_id . "/". $name;
Storage::disk('s3')->put($filePath, file_get_contents($file));
$fileName = Storage::disk('s3')->url($filePath);

Now I am trying to add the KMS feature to my bucket, create my key, and implement the bucket policy. Still, I can't get the possible syntax for uploading/downloading files using KMS for laravel/PHP; I am a newbie here for s3.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source