Use it with laravel media library package #34
-
Hi, I am wondering if is there any a proper way to use it with laravel media library package. Thanks in advance . |
Beta Was this translation helpful? Give feedback.
Answered by
rahulhaque
Jan 10, 2023
Replies: 1 comment 7 replies
-
Yes, there is. // Single file
$model->addMedia(Filepond::field($request->image)->getFile())->usingName('...')->toMediaCollection('...');
// Multiple files
$images = Filepond::field($request->images)->getFile();
foreach ($images as $image) {
$model->addMedia($image)->usingName('...')->toMediaCollection('...');
} I recommend using |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
allaghi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, there is.
I recommend using
preserveOriginal()
if you want the temporary files to be available when used with soft delete enabled.