src/Console/AbstractFileGenerator.php
public function runFileGeneratorCommand($path, $argument)
    {
        if ($this->filesystem->exists($path)) {
            return 'File with the name '.$argument.' already exist';
        }
        $folder_name = explode('/', $argument);
        $folder = '';
        if (count($folder_name) > 1) {
            $folder_path = array_slice($folder_name, 0, -1);
            foreach ($folder_path as $f) {
                $folder .= "$f/";
            }
            $filename = end($folder_name);
        } else {
            $filename = $argument;
        }
        $folder ? $location = "$this->basePath/$folder/$filename.php" : $location = "$this->basePath/$filename.php";
        $template = $this->findTemplateAndReplacePlaceHolders('PlaceHolder', $filename,
            file_get_contents($this->getTemplate($this->type))
        );
        $this->filesystem->dumpFile($location, $template);

        return true;
    }
public function runFileGeneratorCommand($path, $argument)
    {
        if ($this->filesystem->exists($path)) {
            return 'File with the name '.$argument.' already exist';
        }
        $folder_name = explode('/', $argument);
        $folder = '';
        if (count($folder_name) > 1) {
            $folder_path = array_slice($folder_name, 0, -1);
            foreach ($folder_path as $f) {
                $folder .= "$f/";
            }
            $filename = end($folder_name);
        } else {
            $filename = $argument;
        }
        $folder ? $location = "$this->basePath/$folder/$filename.php" : $location = "$this->basePath/$filename.php";
        $template = $this->findTemplateAndReplacePlaceHolders('PlaceHolder', $filename,
            file_get_contents($this->getTemplate($this->type))
        );
        $this->filesystem->dumpFile($location, $template);

        return true;
    }
public function runFileGeneratorCommand ( $ path , $ argument ) { if ( $ this -> filesystem -> exists ( $ path ) ) { return 'File with the name ' . $ argument . ' already exist' ; } $ folder_name = explode ( '/' , $ argument ) ; $ folder = '' ; if ( count ( $ folder_name ) > 1 ) { $ folder_path = array_slice ( $ folder_name , 0 , - 1 ) ; foreach ( $ folder_path as $ f ) { $ folder .= "$f/" ; } $ filename = end ( $ folder_name ) ; } else { $ filename = $ argument ; } $ folder ? $ location = "$this->basePath/$folder/$filename.php" : $ location = "$this->basePath/$filename.php" ; $ template = $ this -> findTemplateAndReplacePlaceHolders ( 'PlaceHolder' , $ filename , file_get_contents ( $ this -> getTemplate ( $ this -> type ) ) ) ; $ this -> filesystem -> dumpFile ( $ location , $ template ) ; return true ; }
Generate and move file to specified path.

@param $path
@param $argument

@return string
Generate and move file to specified path .