@@ -91,10 +91,7 @@ abstract class BaseType
9191 */
9292 private function __construct ()
9393 {
94- $ type = config ("filemanager.type " );
95- $ config = filemanager_config ();
96- $ this ->setConfig ($ config );
97- $ this ->fetchProperties ();
94+ //
9895 }
9996
10097
@@ -118,7 +115,7 @@ public static function getInstance()
118115 * @param array|null $config
119116 * @return $this
120117 */
121- protected function fetchProperties (array $ config = null )
118+ public function fetchProperties (array $ config = null )
122119 {
123120 if (is_null ($ config )) $ config = $ this ->getConfig ();
124121
@@ -207,11 +204,12 @@ public function upload($file)
207204 protected function createFileRow ($ name = null )
208205 {
209206 $ file = File::create ([
210- "name " => $ name ?? $ this ->getName () ?? $ this ->generateRandomName (),
211- "type " => $ this ->getType (),
212- "path " => $ this ->getFilePath (),
213- "format " => $ this ->getFormat (),
214- "private " => $ this ->public ? false : true ,
207+ "name " => $ name ?? $ this ->getName () ?? $ this ->generateRandomName (),
208+ "file_name " => $ this ->getFileName (),
209+ "type " => $ this ->getType (),
210+ "base_path " => $ this ->getUploadPath (),
211+ "format " => $ this ->getFormat (),
212+ "private " => $ this ->public ? false : true ,
215213 ]);
216214 $ this ->setFile ($ file );
217215 return $ file ;
@@ -347,6 +345,17 @@ public function getPath()
347345 }
348346
349347
348+ /**
349+ * get full path
350+ *
351+ * @return string
352+ */
353+ public function getFullPath ()
354+ {
355+ return $ this ->getStorageFolder ($ this ->getUploadPath ());
356+ }
357+
358+
350359 /**
351360 * get upload location path
352361 * we append the prefix
@@ -399,6 +408,19 @@ public function getPrefix()
399408 }
400409
401410
411+ /**
412+ * get set prefix
413+ *
414+ * @param $prefix
415+ * @return string
416+ */
417+ public function setPrefix ($ prefix )
418+ {
419+ $ this ->prefix = $ prefix ;
420+ return $ this ;
421+ }
422+
423+
402424 /**
403425 * check storage path
404426 *
@@ -501,7 +523,7 @@ public function isPublic()
501523 * @param array $parameters
502524 * @return string
503525 */
504- public function getFilePath ($ parameters = [] )
526+ public function getFilePath ()
505527 {
506528 return $ this ->getUploadPath () . $ this ->getFileName ();
507529 }
0 commit comments