public function generate()
{
$templateData = TemplateUtil::getTemplate('repository', 'laravel-generator');
$templateData = TemplateUtil::fillTemplate($this->commandData->dynamicVars, $templateData);
$searchables = [];
foreach ($this->commandData->inputFields as $field) {
if ($field['searchable']) {
$searchables[] = "'" . $field['fieldName'] . "'";
}
}
$templateData = str_replace('$FIELDS$', implode(',' . infy_nl_tab(1, 2), $searchables), $templateData);
FileUtil::createFile($this->path, $this->fileName, $templateData);
$this->commandData->commandComment("\nRepository created: ");
$this->commandData->commandInfo($this->fileName);
}