@@ -41,7 +41,7 @@ public function saveUploadedFile(UploadedFile $file, $attribute, $fileName = '',
4141 $ fileName = $ file ->name ;
4242 }
4343 if ($ autoExtension ) {
44- $ _file = pathinfo ($ fileName , PATHINFO_FILENAME );
44+ $ _file = ( string ) pathinfo ($ fileName , PATHINFO_FILENAME );
4545 $ fileName = $ _file . '. ' . $ file ->extension ;
4646 }
4747
@@ -139,11 +139,23 @@ public function getFilePresignedUrl($attribute)
139139 *
140140 * @return mixed URL expiration
141141 */
142- protected function getPresignedUrlDuration ($ attribute )
142+ public function getPresignedUrlDuration ($ attribute )
143143 {
144144 return '+30 minutes ' ;
145145 }
146146
147+ /**
148+ * List the paths on AWS S3 to each model file attribute.
149+ * It must be a Key-Value array, where Key is the attribute name and Value is the base path for the file in S3.
150+ * Override this method for saving each attribute in its own "folder".
151+ *
152+ * @return array Key-Value of attributes and its paths.
153+ */
154+ public function attributePaths ()
155+ {
156+ return [];
157+ }
158+
147159 /**
148160 * Retrieves the base path on AWS S3 for a given attribute.
149161 * @see attributePaths()
@@ -152,7 +164,7 @@ protected function getPresignedUrlDuration($attribute)
152164 *
153165 * @return string The path where all file of that attribute should be stored. Returns empty string if the attribute isn't in the list.
154166 */
155- protected function getAttributePath ($ attribute )
167+ public function getAttributePath ($ attribute )
156168 {
157169 $ paths = $ this ->attributePaths ();
158170 if (array_key_exists ($ attribute , $ paths )) {
@@ -162,18 +174,6 @@ protected function getAttributePath($attribute)
162174 return '' ;
163175 }
164176
165- /**
166- * List the paths on AWS S3 to each model file attribute.
167- * It must be a Key-Value array, where Key is the attribute name and Value is the base path for the file in S3.
168- * Override this method for saving each attribute in its own "folder".
169- *
170- * @return array Key-Value of attributes and its paths.
171- */
172- protected function attributePaths ()
173- {
174- return [];
175- }
176-
177177 /**
178178 * Check for valid status code from the AWS S3 response.
179179 * Success responses will be considered status codes is 2**.
@@ -183,7 +183,7 @@ protected function attributePaths()
183183 *
184184 * @return bool whether this response is successful.
185185 */
186- protected function isSuccessResponseStatus ($ response )
186+ public function isSuccessResponseStatus ($ response )
187187 {
188188 return !empty ($ response ->get ('@metadata ' )['statusCode ' ]) &&
189189 $ response ->get ('@metadata ' )['statusCode ' ] >= 200 &&
0 commit comments