Baum\Generators\ModelGenerator::create PHP Method

create() public method

Create a new model at the given path.
public create ( string $name, string $path ) : string
$name string
$path string
return string
    public function create($name, $path)
    {
        $path = $this->getPath($name, $path);
        $stub = $this->getStub('model');
        $this->files->put($path, $this->parseStub($stub, ['table' => $this->tableize($name), 'class' => $this->classify($name)]));
        return $path;
    }

Usage Example

Beispiel #1
0
 /**
  * Write the model file to disk.
  *
  * @param  string  $name
  * @return string
  */
 protected function writeModel($name)
 {
     $output = pathinfo($this->modeler->create($name, $this->getModelsPath()), PATHINFO_FILENAME);
     $this->line("      <fg=green;options=bold>create</fg=green;options=bold>  {$output}");
 }
ModelGenerator