A simple extention of https://github.com/jacobcyl/Aliyun-oss-storage
Extended AliOssAdapter and added signUrl()
function to generate signed url and getTemporaryUrl()
function to generate temporary url using Storage::temporaryUrl()
.
In your config/app.php
add this line to providers array:
\App\Media\Providers\AliOssServiceProvider::class,
See Laravel doc for Storage Or you can learn here:
First you must use Storage facade
use Storage;
Then You can use
temporaryUrl
function of Storage
Storage::temporaryUrl('path/to/img.jpg', now()->addMinutes(5)) // 5 minutes
Storage::temporaryUrl('path/to/img.jpg', 60) // 60 second