ContinentsTableSeeder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 13
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 16 2
1
<?php
2
3
use Illuminate\Database\Seeder;
4
5
/*
6
|--------------------------------------------------------------------------
7
| Seeders
8
|--------------------------------------------------------------------------
9
|
10
| Seders are used to generate datas to populate the database of the test environment.
11
|
12
*/
13
14
class ContinentsTableSeeder extends Seeder
15
{
16
    /**
17
     * Run the database seeds.
18
     *
19
     * @return void
20
     */
21
    public function run()
22
    {
23
        $continents = [
24
            ['id' => '1', 'name' => 'Africa', 'code' => 'AF'],
25
            ['id' => '3', 'name' => 'North America', 'code' => 'NA'],
26
            ['id' => '4', 'name' => 'Oceania', 'code' => 'OC'],
27
            ['id' => '5', 'name' => 'Asia', 'code' => 'AS'],
28
            ['id' => '6', 'name' => 'Europe', 'code' => 'EU'],
29
            ['id' => '7', 'name' => 'South America', 'code' => 'SA'],
30
        ];
31
32
        foreach ($continents as $key => $continent) {
33
            DB::table('continents')->insert([
34
                'id' => $continent['id'],
35
                'name' => $continent['name'],
36
                'code' => $continent['code'],
37
            ]);
38
        }
39
    }
40
}
41