From e4cb2fafbace11656927ec61dce9f57e88d86ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Gaulin?= Date: Fri, 15 Mar 2019 09:05:37 +0400 Subject: [PATCH] Do not used deprecated method --- src/Attachment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Attachment.php b/src/Attachment.php index 595563f..efa0e76 100644 --- a/src/Attachment.php +++ b/src/Attachment.php @@ -107,7 +107,7 @@ public function fromPost($uploadedFile, $disk = null) $this->disk = $this->disk ?: ($disk ?: Storage::getDefaultDriver()); $this->filename = $uploadedFile->getClientOriginalName(); - $this->filesize = $uploadedFile->getClientSize(); + $this->filesize = method_exists($uploadedFile, 'getSize') ? $uploadedFile->getSize() : $uploadedFile->getClientSize(); $this->filetype = $uploadedFile->getMimeType(); $this->filepath = $this->filepath ?: ($this->getStorageDirectory() . $this->getPartitionDirectory() . $this->getDiskName()); $this->putFile($uploadedFile->getRealPath(), $this->filepath);