<?php

use Illuminate\Database\Seeder;
use App\User;

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
        $inserts = array(
            array(
                'Admin','Guntref', 'admin@admin.com', '1234',1

            ),
            array(
                'unit-1', 'Team Leader','test@tester.com', 'pass',0
            ),
            array(
                'uni-1','Team Member', 'test2@tester.com', 'pass',0
            ),
        );


        for ($i = 0; $i < count($inserts); $i++) {
            $model = null;
            $model = new User();
            $model->name = $inserts[$i][0];
            $model->surname = $inserts[$i][1];
            $model->email = $inserts[$i][2];
            $model->password = bcrypt($inserts[$i][3]);
            $model->admin =  $inserts[$i][4];
            $model->save();

        }
    }
}
