<?php

use Illuminate\Database\Seeder;
use App\Role;
use App\User;
class UsersSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $adminRole  = new Role();
        $adminRole->name = "admin";
        $adminRole->display_name  = "Admin";
        $adminRole->save();//

        $adminRMRole  = new Role();
        $adminRMRole->name  = "adminRM";
        $adminRMRole->display_name  = "Admin RM";
        $adminRMRole->save();

        $memberRole = new Role();
        $memberRole->name = "member";
        $memberRole->display_name = "Member";
        $memberRole->save();

        $admin  = new User();
        $admin->name  = 'Admin GeMakan';
        $admin->email = 'admin@gmail.com';
        $admin->password  = bcrypt('admin');
        $admin->is_verified = 1;
        $admin->save();
        $admin->attachRole($adminRole);

        $adminRM = new User();
        $adminRM->name  = 'Admin Mak Robi';
        $adminRM->email = 'makrobi@gmail.com';
        $adminRM->password  = bcrypt('admin');
        $adminRM->save();
        $adminRM->attachRole($adminRMRole);

        $member = new User();
        $member->name = 'GeMakan Member';
        $member->email  = 'member@gmail.com';
        $member->password = bcrypt('member');
        $member->is_verified = 1;
        $member->save();
        $member->attachRole($memberRole);
    }
}
