field('{$primaryKey}');"; } foreach ($fields as $k => $field) { if (empty($field['name'])) { continue; } $rows[] = " \$show->field('{$field['name']}');"; // if ($k === 1 && (count($fields) > 2 || $timestamps)) { // $rows[] = ' $show->divider();'; // } } if ($timestamps) { $rows[] = ' $show->field(\'created_at\');'; $rows[] = ' $show->field(\'updated_at\');'; } return trim(implode("\n", $rows)); } }