mod mediaController
This commit is contained in:
parent
00592aca0e
commit
d429b8959b
|
@ -45,10 +45,12 @@ class MediaController
|
|||
|
||||
$medias = collect($content)->map(function ($c) use ($collection, $model) {
|
||||
$pathinfo = pathinfo($c['name']);
|
||||
$path = $collection->runCallback('forceFileName', $model, $pathinfo['filename']).'.'.$pathinfo['extension'];
|
||||
Storage::disk('public')->put($path, base64_decode($c['content']));
|
||||
$basename = $collection->runCallback('forceFileName', $model, $pathinfo['filename']);
|
||||
$path = $basename.'.'.$pathinfo['extension'];
|
||||
$adder = $model
|
||||
->addMedia(Storage::disk('public')->path($path))
|
||||
->addMediaFromBase64($c['content'])
|
||||
->usingName($basename)
|
||||
->usingFileName($path)
|
||||
->withCustomProperties($collection->runCallback('withDefaultProperties', $path));
|
||||
|
||||
return tap(
|
||||
|
|
Loading…
Reference in New Issue