mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-24 18:00:40 +00:00
format
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\Files\Actions;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@@ -22,9 +21,7 @@ class GenerateImageThumbnailAction
|
||||
|
||||
collect(config("vuefilemanager.image_sizes.$execution"))
|
||||
->each(function ($size) use ($image, $userId, $fileName, $imageWidth) {
|
||||
|
||||
if ($imageWidth > $size['size']) {
|
||||
|
||||
// Create intervention image
|
||||
$intervention = Image::make($image)->orientate();
|
||||
|
||||
|
||||
@@ -3,10 +3,8 @@ namespace Domain\Files\Actions;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
|
||||
class ProcessImageThumbnailAction
|
||||
{
|
||||
|
||||
public function __construct(
|
||||
public GenerateImageThumbnailAction $generateImageThumbnail,
|
||||
) {}
|
||||
@@ -27,10 +25,8 @@ class ProcessImageThumbnailAction
|
||||
$file,
|
||||
string $userId
|
||||
): void {
|
||||
|
||||
// Create thumbnail from image
|
||||
if (in_array($file->getClientMimeType(), $this->availableFormats)) {
|
||||
|
||||
// Make copy of file for the thumbnail generation
|
||||
Storage::disk('local')->copy("files/$userId/{$fileName}", "temp/$userId/{$fileName}");
|
||||
|
||||
|
||||
@@ -14,12 +14,11 @@ use App\Users\Actions\CheckStorageCapacityAction;
|
||||
class UploadFileAction
|
||||
{
|
||||
public function __construct(
|
||||
public RecordUploadAction $recordUpload,
|
||||
public CheckStorageCapacityAction $checkStorageCapacity,
|
||||
public ProcessImageThumbnailAction $createImageThumbnail,
|
||||
public RecordUploadAction $recordUpload,
|
||||
public CheckStorageCapacityAction $checkStorageCapacity,
|
||||
public ProcessImageThumbnailAction $createImageThumbnail,
|
||||
public MoveFileToExternalStorageAction $moveFileToExternalStorage,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Upload new file
|
||||
@@ -69,7 +68,6 @@ class UploadFileAction
|
||||
// Check if user has enough space to upload file
|
||||
($this->checkStorageCapacity)($user_id, $fileSize, $chunkName);
|
||||
|
||||
|
||||
// Move finished file from chunk to file-manager directory
|
||||
$disk_local->move("chunks/$chunkName", "files/$user_id/$fileName");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user