original_string: private function setNewFilename($newfilename = null)
      {
          $extension = $this->results['original_extension'];
          $originalFilename = $this->results['original_filename'];
  
          $timestamp = Carbon::now()->getTimestamp();
  
          switch ($this->newfilename) {
              case 'hash':
                  $newfilename = md5($originalFilename.$timestamp);
                  break;
              case 'random':
                  $newfilename = Str::random(16);
                  break;
              case 'timestamp':
                  $newfilename = $timestamp;
                  break;
              case 'custom':
                  $newfilename = (! empty($newfilename) ? $newfilename : $originalFilename);
                  break;
              default:
                  $newfilename = pathinfo($originalFilename, PATHINFO_FILENAME);
          }
  
          $this->results['basename'] = (string) $newfilename;
          $this->results['filename'] = $newfilename.'.'.$extension;
  
          return $this;
      }
code: private function setNewFilename($newfilename = null)
      {
          $extension = $this->results['original_extension'];
          $originalFilename = $this->results['original_filename'];
  
          $timestamp = Carbon::now()->getTimestamp();
  
          switch ($this->newfilename) {
              case 'hash':
                  $newfilename = md5($originalFilename.$timestamp);
                  break;
              case 'random':
                  $newfilename = Str::random(16);
                  break;
              case 'timestamp':
                  $newfilename = $timestamp;
                  break;
              case 'custom':
                  $newfilename = (! empty($newfilename) ? $newfilename : $originalFilename);
                  break;
              default:
                  $newfilename = pathinfo($originalFilename, PATHINFO_FILENAME);
          }
  
          $this->results['basename'] = (string) $newfilename;
          $this->results['filename'] = $newfilename.'.'.$extension;
  
          return $this;
      }
code_tokens: private function setNewFilename ( $ newfilename = null ) { $ extension = $ this -> results [ 'original_extension' ] ; $ originalFilename = $ this -> results [ 'original_filename' ] ; $ timestamp = Carbon :: now ( ) -> getTimestamp ( ) ; switch ( $ this -> newfilename ) { case 'hash' : $ newfilename = md5 ( $ originalFilename . $ timestamp ) ; break ; case 'random' : $ newfilename = Str :: random ( 16 ) ; break ; case 'timestamp' : $ newfilename = $ timestamp ; break ; case 'custom' : $ newfilename = ( ! empty ( $ newfilename ) ? $ newfilename : $ originalFilename ) ; break ; default : $ newfilename = pathinfo ( $ originalFilename , PATHINFO_FILENAME ) ; } $ this -> results [ 'basename' ] = ( string ) $ newfilename ; $ this -> results [ 'filename' ] = $ newfilename . '.' . $ extension ; return $ this ; }
docstring: Set new file name from config.
  
  @access private
  @param string $newfilename (default: null)
docstring_tokens: Set new file name from config .