public function store(string $folderName = null, string $fileName = null): string
	{
		$folderName = $folderName ?? date('Ymd');
		$fileName   = $fileName ?? $this->getRandomName();

		// Move the uploaded file to a new location.
		return ($this->move(WRITEPATH . 'uploads/' . $folderName, $fileName)) ?
				$folderName . DIRECTORY_SEPARATOR . $this->name : null;
	}
public function store(string $folderName = null, string $fileName = null): string
	{
		$folderName = $folderName ?? date('Ymd');
		$fileName   = $fileName ?? $this->getRandomName();

		// Move the uploaded file to a new location.
		return ($this->move(WRITEPATH . 'uploads/' . $folderName, $fileName)) ?
				$folderName . DIRECTORY_SEPARATOR . $this->name : null;
	}
public function store ( string $ folderName = null , string $ fileName = null ) : string { $ folderName = $ folderName ?? date ( 'Ymd' ) ; $ fileName = $ fileName ?? $ this -> getRandomName ( ) ; // Move the uploaded file to a new location. return ( $ this -> move ( WRITEPATH . 'uploads/' . $ folderName , $ fileName ) ) ? $ folderName . DIRECTORY_SEPARATOR . $ this -> name : null ; }
Save the uploaded file to a new location.

By default, upload files are saved in writable/uploads directory. The YYYYMMDD folder
and random file name will be created.

@param  string $folderName the folder name to writable/uploads directory.
@param  string $fileName   the name to rename the file to.
@return string file full path
Save the uploaded file to a new location .