Code Duplication    Length = 15-15 lines in 4 locations

app/Console/Commands/MakeJsonApiDemo.php 4 locations

@@ 174-188 (lines=15) @@
171
    /**
172
     *
173
     */
174
    protected function copyJsonApiEntities()
175
    {
176
        foreach ($this->jsonapiEntities as $key => $value) {
177
            if (file_exists(app_path('JsonApi/'.$value)) && ! $this->option('force')) {
178
                if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
179
                    continue;
180
                }
181
            }
182
183
            copy(
184
                base_path('stubs/'.$key),
185
                app_path($value)
186
            );
187
        }
188
    }
189
190
    /**
191
     *
@@ 193-207 (lines=15) @@
190
    /**
191
     *
192
     */
193
    protected function exportControllers()
194
    {
195
        foreach ($this->controllers as $key => $value) {
196
            if (file_exists(app_path('Http/Controllers/Api/v1/'.$value)) && ! $this->option('force')) {
197
                if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
198
                    continue;
199
                }
200
            }
201
202
            copy(
203
                base_path('stubs/Controllers/'.$key),
204
                app_path('Http/Controllers/Api/v1/'.$value)
205
            );
206
        }
207
    }
208
209
    /**
210
     *
@@ 212-226 (lines=15) @@
209
    /**
210
     *
211
     */
212
    protected function exportModels()
213
    {
214
        foreach ($this->models as $key => $value) {
215
            if (file_exists(app_path('Models/'.$value)) && ! $this->option('force')) {
216
                if (! $this->confirm("The [{$value}] model already exists. Do you want to replace it?")) {
217
                    continue;
218
                }
219
            }
220
221
            copy(
222
                base_path('stubs/Models/'.$key),
223
                app_path('Models/'.$value)
224
            );
225
        }
226
    }
227
228
    /**
229
     *
@@ 251-265 (lines=15) @@
248
    /**
249
     *
250
     */
251
    protected function exportSeeds()
252
    {
253
        foreach ($this->seeds as $key => $value) {
254
            if (file_exists(database_path('seeds/'.$value)) && ! $this->option('force')) {
255
                if (! $this->confirm("The [{$value}] already exists. Do you want to replace it?")) {
256
                    continue;
257
                }
258
            }
259
260
            copy(
261
                base_path('stubs/seeds/'.$key),
262
                database_path('seeds/'.$value)
263
            );
264
        }
265
    }
266
267
    /**
268
     * @param $src