public function modelCommand($input, $modelName, $optimized = false)
    {
        if (strpos($modelName, '\\') === false) {
            $modelName = 'App\\Models\\' . ucfirst($modelName);
        }

        $fieldTypes = $this->_inferFieldTypes([$input]);
        $model = $this->_renderModel($fieldTypes, $modelName, 'mongodb', $optimized);
        $file = '@tmp/mongodb_model/' . substr($modelName, strrpos($modelName, '\\') + 1) . '.php';
        $this->filesystem->filePut($file, $model);

        $this->console->writeLn(['write model to :file', 'file' => $file]);
    }
public function modelCommand($input, $modelName, $optimized = false)
    {
        if (strpos($modelName, '\\') === false) {
            $modelName = 'App\\Models\\' . ucfirst($modelName);
        }

        $fieldTypes = $this->_inferFieldTypes([$input]);
        $model = $this->_renderModel($fieldTypes, $modelName, 'mongodb', $optimized);
        $file = '@tmp/mongodb_model/' . substr($modelName, strrpos($modelName, '\\') + 1) . '.php';
        $this->filesystem->filePut($file, $model);

        $this->console->writeLn(['write model to :file', 'file' => $file]);
    }
public function modelCommand ( $ input , $ modelName , $ optimized = false ) { if ( strpos ( $ modelName , '\\' ) === false ) { $ modelName = 'App\\Models\\' . ucfirst ( $ modelName ) ; } $ fieldTypes = $ this -> _inferFieldTypes ( [ $ input ] ) ; $ model = $ this -> _renderModel ( $ fieldTypes , $ modelName , 'mongodb' , $ optimized ) ; $ file = '@tmp/mongodb_model/' . substr ( $ modelName , strrpos ( $ modelName , '\\' ) + 1 ) . '.php' ; $ this -> filesystem -> filePut ( $ file , $ model ) ; $ this -> console -> writeLn ( [ 'write model to :file' , 'file' => $ file ] ) ; }
generate model file from base64 encoded string

@param string $input the base64 encoded json string
@param string $modelName
@param bool   $optimized output as more methods as possible
generate model file from base64 encoded string