📅  最后修改于: 2022-03-11 14:54:22.796000             🧑  作者: Mango
//To retrieve files you can use the getMedia-method:
$mediaItems = $yourModel->getMedia();
//The method returns a collection of Media-objects.
//You can retrieve the url and path to the file associated with the Media-object using getUrl, getTemporaryUrl (for S3 only) and getPath:
$publicUrl = $mediaItems[0]->getUrl();
$publicFullUrl = $mediaItems[0]->getFullUrl(); //url including domain
$fullPathOnDisk = $mediaItems[0]->getPath();
$temporaryS3Url = $mediaItems[0]->getTemporaryUrl(Carbon::now()->addMinutes(5));