src/GenericFile.php
public function moveUploadedFile(File $file, $path_pattern = null)
	{
		// inperpolate path_pattern using $file
		// and get interpolator result object

		$interpolated = $this->interpolator->resolveStorePath(
			$path_pattern ?: $this->getConfig('store.path_pattern', ''), $file);

		// file will be moved to interpolated path
		// using configured public_path as root

		$target = $this->getStoreRootPath() . '/' . ltrim($interpolated, '/');

		if ( ! file_exists($target))
		{
			$file->move(dirname($target), basename($target));
		}

		return $interpolated;
	}
public function moveUploadedFile(File $file, $path_pattern = null)
	{
		// inperpolate path_pattern using $file
		// and get interpolator result object

		$interpolated = $this->interpolator->resolveStorePath(
			$path_pattern ?: $this->getConfig('store.path_pattern', ''), $file);

		// file will be moved to interpolated path
		// using configured public_path as root

		$target = $this->getStoreRootPath() . '/' . ltrim($interpolated, '/');

		if ( ! file_exists($target))
		{
			$file->move(dirname($target), basename($target));
		}

		return $interpolated;
	}
public function moveUploadedFile ( File $ file , $ path_pattern = null ) { // inperpolate path_pattern using $file // and get interpolator result object $ interpolated = $ this -> interpolator -> resolveStorePath ( $ path_pattern ? : $ this -> getConfig ( 'store.path_pattern' , '' ) , $ file ) ; // file will be moved to interpolated path // using configured public_path as root $ target = $ this -> getStoreRootPath ( ) . '/' . ltrim ( $ interpolated , '/' ) ; if ( ! file_exists ( $ target ) ) { $ file -> move ( dirname ( $ target ) , basename ( $ target ) ) ; } return $ interpolated ; }
Move uploaded file to path by pattern

@param  File $file
@param  string|null $path_pattern

@return string|null
Move uploaded file to path by pattern