<?php

namespace App\Controllers;

use CodeIgniter\Shield\Entities\User;

class Addcutom extends BaseController
{
    public function index()
    {
        $user_provider = auth()->getProvider();
        $user = new User([
            'username' => 'warga',
            'email'    => 'warga@gmail.com',
            'password' => '12345678',
        ]);
        $user_provider->save($user);

        $user = $user_provider->findById($user_provider->getInsertID());
        $user->addgroup("warga");
        echo "ok";
        //echo "tes";
    }
}
