📅  最后修改于: 2022-03-11 15:00:46.052000             🧑  作者: Mango
foreach ($data['images'] as $image) {
$article->addMediaFromBase64($image)->toMediaCollection('article-images');
$mediaItems = $article->load('media')->getMedia('article-images');
$article->content = str_replace($image, $mediaItems[count($mediaItems) - 1]->getFullUrl(), $article->content);
}