<?php

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

class UserRoleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $user = User::where("email", "=" , "user@example.com")->first();
        $admin = User::where("email", "=", "admin@example.com")->first();

        $role_user = Role::where('name','=','member')->first();
        $role_admin =  Role::where('name','=','admin')->first();
        
        $user->attachRole($role_user);
        $admin->attachRole($role_admin);
    }
}
