Completed
Push — master ( 39d8f5...f43223 )
by Travis
02:07
created

UserSeeder::run()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 20

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 31
rs 8.8571
cc 1
eloc 20
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Seeder;
4
5
class UserSeeder extends Seeder
6
{
7
8
    public function run()
9
    {
10
        // Uncomment the below to wipe the table clean before populating
11
        DB::statement('SET FOREIGN_KEY_CHECKS=0;');
12
        DB::table('users')->truncate();
13
        DB::statement('SET FOREIGN_KEY_CHECKS=1;');
14
15
        $users = [
16
            [
17
                'username'   => 'riddles',
18
                'password'   => bcrypt('test'),
19
                'firstName'  => 'Brandon',
20
                'lastName'   => 'Hyde',
21
                'email'      => '[email protected]',
22
                'timezone'   => 'US/Central',
23
                'created_at' => date('Y-m-d H:i:s'),
24
            ],
25
            [
26
                'username'   => 'Stygian',
27
                'password'   => bcrypt('test'),
28
                'firstName'  => 'Travis',
29
                'lastName'   => 'Blasingame',
30
                'email'      => '[email protected]',
31
                'timezone'   => 'US/Central',
32
                'created_at' => date('Y-m-d H:i:s'),
33
            ],
34
        ];
35
36
        // Uncomment the below to run the seeder
37
        DB::table('users')->insert($users);
38
    }
39
}