Using Google Cloud Storage or Firebase Storage APIs in core PHP code
Used API - https://github.com/googleapis/google-cloud-php-storage
To begin, install the preferred dependency manager for PHP, Composer.
Now to install just this component:
$ composer require google/cloud-storage
Or to install the entire suite of components at once:
$ composer require google/cloud
In the Firebase console, open Settings > Service Accounts.
Click Generate New Private Key, then confirm by clicking Generate Key.
Securely store the JSON file containing the key.
If you want to auto delete files after some time then follow this https://cloud.google.com/storage/docs/managing-lifecycles
Rahul K Raj