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

BanksTableSeeder::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 12
c 1
b 0
f 1
dl 0
loc 16
rs 9.8666
cc 1
nc 1
nop 0
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