Nvd\Crud\Commands\Crud::generateModel PHP Method

generateModel() public method

public generateModel ( )
    public function generateModel()
    {
        $modelFile = $this->modelsDir() . '/' . $this->modelClassName() . ".php";
        if ($this->confirmOverwrite($modelFile)) {
            $content = view($this->templatesDir() . '.model', ['gen' => $this, 'fields' => Db::fields($this->tableName)]);
            file_put_contents($modelFile, $content);
            $this->info("Model class " . $this->modelClassName() . " generated successfully.");
        }
    }