<?php

namespace App\Controllers;

use CodeIgniter\Controller;

class MakeAdmin extends Controller
{
    public function index()
    {
        $users = auth()->getProvider();

        // ganti email ini sesuai akun admin yang kamu login
        $user = $users->findByCredentials(['email' => 'adminsentosabhakti@gmail.com']);

        if (! $user) {
            return "User tidak ditemukan";
        }

        $user->addGroup('admin');

        return "OK, user sudah masuk group admin";
    }
}
