Code Duplication    Length = 25-27 lines in 2 locations

src/Console/ResourceGenerator.php 2 locations

@@ 164-190 (lines=27) @@
161
        return $output;
162
    }
163
164
    public function generateShow()
165
    {
166
        $output = '';
167
168
        foreach ($this->getTableColumns() as $column) {
169
            $name = $column->getName();
170
            switch ($name) {
171
                case 'id':
172
                case 'created_at':
173
                case 'updated_at':
174
                    $label = trans('admin.'.$this->formatLabel($name));
175
                    break;
176
                
177
                default:
178
                    // set column label
179
                    $label = $this->formatLabel($name);
180
                    break;
181
            }
182
            
183
184
            $output .= sprintf($this->formats['show_field'], $name, $label);
185
186
            $output .= ";\r\n";
187
        }
188
189
        return $output;
190
    }
191
192
    public function generateGrid()
193
    {
@@ 192-216 (lines=25) @@
189
        return $output;
190
    }
191
192
    public function generateGrid()
193
    {
194
        $output = '';
195
196
        foreach ($this->getTableColumns() as $column) {
197
            $name = $column->getName();
198
            switch ($name) {
199
                case 'id':
200
                case 'created_at':
201
                case 'updated_at':
202
                    $label = trans('admin.'.$this->formatLabel($name));
203
                    break;
204
                
205
                default:
206
                    // set column label
207
                    $label = $this->formatLabel($name);
208
                    break;
209
            }
210
211
            $output .= sprintf($this->formats['grid_column'], $name, $label);
212
            $output .= ";\r\n";
213
        }
214
215
        return $output;
216
    }
217
218
    protected function getReservedColumns()
219
    {