classes/Commands/Generate.php
private function generateModel()
    {
        // Figure out the naming
        $model = ucfirst($this->argument('model'));
        $path = 'app/'.$model.'.php';
        $file = base_path().'/'.$path;

        // Copy the stub over
        if (file_exists($file)) {
            return $this->comment('Model already exists: '.$path);
        }
        file_put_contents($file, str_replace('{{model}}', $model, file_get_contents($this->stubs.'/model.stub')));
        $this->info('Model created: '.$path);
    }
private function generateModel()
    {
        // Figure out the naming
        $model = ucfirst($this->argument('model'));
        $path = 'app/'.$model.'.php';
        $file = base_path().'/'.$path;

        // Copy the stub over
        if (file_exists($file)) {
            return $this->comment('Model already exists: '.$path);
        }
        file_put_contents($file, str_replace('{{model}}', $model, file_get_contents($this->stubs.'/model.stub')));
        $this->info('Model created: '.$path);
    }
private function generateModel ( ) { // Figure out the naming $ model = ucfirst ( $ this -> argument ( 'model' ) ) ; $ path = 'app/' . $ model . '.php' ; $ file = base_path ( ) . '/' . $ path ; // Copy the stub over if ( file_exists ( $ file ) ) { return $ this -> comment ( 'Model already exists: ' . $ path ) ; } file_put_contents ( $ file , str_replace ( '{{model}}' , $ model , file_get_contents ( $ this -> stubs . '/model.stub' ) ) ) ; $ this -> info ( 'Model created: ' . $ path ) ; }
Create the model file
Create the model file