Closed chrispage1 closed 4 months ago
This feature adds the ability to customise the FileAdder options when performing a copy action.
In my case, the requirement for this is to set properties against the media item, but it gives the user access to all of the FileAdder methods. Example:
properties
use Spatie\MediaLibrary\MediaCollections\FileAdder;; $media->copy( $postModel, fileAdderCallback: fn (FileAdder $adder): FileAdder => $adder->withProperties([ 'duplicate_of' => $oldMedia->getKey(), ]) );
Thanks!
Thank you!
This feature adds the ability to customise the FileAdder options when performing a copy action.
In my case, the requirement for this is to set
properties
against the media item, but it gives the user access to all of the FileAdder methods. Example:Thanks!