Search code examples
phplaravelapiamazon-s3flysystem

How can i get the storage class of a object in Amazon S3 in Laravel


I need to get the storage class of a object in a s3 bucket using the Laravel flysystem, but the class has no method, how can this be done.


Solution

  • The project thephpleague/flysystem-aws-s3-v3 needs updating to be more eloquent.

    In Blade:

    @php
       $as3StorageMetaData = ($as3Storage->getMetadata($file));
    @endphp
    

    In file loop use:

    $as3StorageMetaData["storageclass"]
    

    returns a constant.

    This project could do with the function getStorageClass