Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "codesleeve/stapler",
"name": "a7madev/stapler",
"description": "Elegant and simple ORM-based file upload package for php.",
"keywords": ["ORM", "file", "upload", "S3", "AWS", "paperclip"],
"license": "MIT",
Expand Down
25 changes: 15 additions & 10 deletions src/Storage/S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,22 @@ public function path($styleName)
return $this->attachedFile->getInterpolator()->interpolate($this->attachedFile->path, $this->attachedFile, $styleName);
}

/**
* Remove an attached file.
*
* @param array $filePaths
*/
public function remove(array $filePaths)
{
if ($filePaths) {
$this->s3Client->deleteObjects(['Bucket' => $this->attachedFile->s3_object_config['Bucket'], 'Objects' => $this->getKeys($filePaths)]);
}
/**
* Remove an attached file.
*
* @param array $filePaths
*/
public function remove(array $filePaths)
{
if ($filePaths) {
$this->s3Client->deleteObjects([
'Bucket' => $this->attachedFile->s3_object_config['Bucket'],
'Delete' => [
'Objects' => $this->getKeys($filePaths)
],
]);
}
}

/**
* Move an uploaded file to it's intended destination.
Expand Down