database/seeds/UserTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $admin_role=Role::where('name','Admin')->first();
       $admin=new User();
       $admin->email="admin";
       $admin->name="admin";
       $admin->password=bcrypt('admin856366');
       $admin->save();
       $admin->roles()->attach($admin_role);
    }
public function run ( ) { $ admin_role = Role :: where ( 'name' , 'Admin' ) -> first ( ) ; $ admin = new User ( ) ; $ admin -> email = " admin " ; $ admin -> name = " admin " ; $ admin -> password = bcrypt ( 'admin856366' ) ; $ admin -> save ( ) ; $ admin -> roles ( ) -> attach ( $ admin_role ) ; }
Run the database seeds.
Run the database seeds .
//retrieve admin role //