ContinentsTableSeeder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

1 Method

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