@@ -34,7 +34,7 @@ public function upload()
3434 }
3535
3636 if (is_array ($ files )) {
37- $ response = count ($ error_bag ) > 0 ? $ error_bag : $ this -> success_response ;
37+ $ response = count ($ error_bag ) > 0 ? $ error_bag : parent :: $ success_response ;
3838 } else { // upload via ckeditor 'Upload' tab
3939 $ response = $ this ->useFile ($ new_filename );
4040 }
@@ -54,7 +54,7 @@ private function proceedSingleUpload($file)
5454
5555 event (new ImageIsUploading ($ new_file_path ));
5656 try {
57- if ($ this -> fileIsImage ($ file ) && $ this -> isImageToThumb ($ file )) {
57+ if (parent :: fileIsImage ($ file ) && parent :: isImageToThumb ($ file )) {
5858 Image::make ($ file ->getRealPath ())
5959 ->orientate () //Apply orientation from exif data
6060 ->save ($ new_file_path , 90 );
@@ -65,7 +65,7 @@ private function proceedSingleUpload($file)
6565 File::move ($ file ->path (), $ new_file_path );
6666 }
6767 } catch (\Exception $ e ) {
68- return $ this -> error ('invalid ' );
68+ return parent :: error ('invalid ' );
6969 }
7070 event (new ImageWasUploaded (realpath ($ new_file_path )));
7171
@@ -78,40 +78,40 @@ private function uploadValidator($file)
7878 $ force_invalid = false ;
7979
8080 if (empty ($ file )) {
81- return $ this -> error ('file-empty ' );
81+ return parent :: error ('file-empty ' );
8282 } elseif (!$ file instanceof UploadedFile) {
83- return $ this -> error ('instance ' );
83+ return parent :: error ('instance ' );
8484 } elseif ($ file ->getError () == UPLOAD_ERR_INI_SIZE ) {
8585 $ max_size = ini_get ('upload_max_filesize ' );
86- return $ this -> error ('file-size ' , ['max ' => $ max_size ]);
86+ return parent :: error ('file-size ' , ['max ' => $ max_size ]);
8787 } elseif ($ file ->getError () != UPLOAD_ERR_OK ) {
8888 return 'File failed to upload. Error code: ' . $ file ->getError ();
8989 }
9090
9191 $ new_filename = $ this ->getNewName ($ file );
9292
9393 if (File::exists (parent ::getCurrentPath ($ new_filename ))) {
94- return $ this -> error ('file-exist ' );
94+ return parent :: error ('file-exist ' );
9595 }
9696
9797 $ mimetype = $ file ->getMimeType ();
9898
9999 // size to kb unit is needed
100100 $ file_size = $ file ->getSize () / 1000 ;
101- $ type_key = $ this -> currentLfmType ();
101+ $ type_key = parent :: currentLfmType ();
102102
103103 if (config ('lfm.should_validate_mime ' )) {
104104 $ mine_config = 'lfm.valid_ ' . $ type_key . '_mimetypes ' ;
105105 $ valid_mimetypes = config ($ mine_config , []);
106106 if (false === in_array ($ mimetype , $ valid_mimetypes )) {
107- return $ this -> error ('mime ' ) . $ mimetype ;
107+ return parent :: error ('mime ' ) . $ mimetype ;
108108 }
109109 }
110110
111111 if (config ('lfm.should_validate_size ' )) {
112112 $ max_size = config ('lfm.max_ ' . $ type_key . '_size ' , 0 );
113113 if ($ file_size > $ max_size ) {
114- return $ this -> error ('size ' ) . $ mimetype ;
114+ return parent :: error ('size ' ) . $ mimetype ;
115115 }
116116 }
117117
@@ -120,7 +120,7 @@ private function uploadValidator($file)
120120
121121 private function getNewName ($ file )
122122 {
123- $ new_filename = $ this -> translateFromUtf8 (trim (pathinfo ($ file ->getClientOriginalName (), PATHINFO_FILENAME )));
123+ $ new_filename = parent :: translateFromUtf8 (trim (pathinfo ($ file ->getClientOriginalName (), PATHINFO_FILENAME )));
124124
125125 if (config ('lfm.rename_file ' ) === true ) {
126126 $ new_filename = uniqid ();
@@ -134,7 +134,7 @@ private function getNewName($file)
134134 private function makeThumb ($ new_filename )
135135 {
136136 // create thumb folder
137- $ this -> createFolderByPath (parent ::getThumbPath ());
137+ parent :: createFolderByPath (parent ::getThumbPath ());
138138
139139 // create thumb image
140140 Image::make (parent ::getCurrentPath ($ new_filename ))
0 commit comments