public function scaffold($modelName, $fields = [])
{
$this->fields = $fields;
$this->hydrateConstants($modelName);
$this->setViewFiles();
$this->setSrcFiles();
$this->setPages();
$this->setApis();
$this->extendConstansts($modelName);
if ($this->SanityChecksHelper->runSanityCheck($this->constants, $this->viewFiles, $this->srcFiles)) {
// Make View Files from templates
$this->makeViewFiles();
// Make App Src Files from templates
$this->makeSrcFiles();
// Build and run the migration for the new model
$this->MigrationScaffolding->buildAndRun($this->constants, $this->fields);
// Insert template configuration in Devise templates.php config
$this->TemplateScaffolding->insertTemplateConfiguration($this->viewFiles);
// Build it and run it
$this->SeederScaffolding->build($this->constants);
// Create Pages in Database
$this->createPages($this->pages);
// Create APIs in Database
$this->createPages($this->apis);
return true;
} else {
return false;
}
}