Test Failed
Push — master ( 045eb7...da5525 )
by Nur
08:45
created

BanksTableSeeder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 13
c 1
b 0
f 1
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 16 1
1
<?php
2
3
4
namespace Turahe\Master\Seeds;
5
6
use Illuminate\Database\Seeder;
7
use Turahe\Master\Models\Banks;
8
9
class BanksTableSeeder extends Seeder
10
{
11
    public function run()
12
    {
13
        $file = __DIR__.'/../../resources/banks.json';
14
        $data = json_decode(file_get_contents($file), true);
15
        $banks = array_map(function ($arr) {
16
            return [
17
                'name' => $arr['name'],
18
                'alias' => $arr['alias'],
19
                'company' => $arr['company'],
20
                'code' => $arr['code'],
21
                'created_at' => now()->toDateTimeString(),
22
                'updated_at' => now()->toDateTimeString(),
23
            ];
24
        }, $data);
25
26
        Banks::insert($banks);
27
    }
28
}
29