Войдите по электронной почте или имени пользователя Codeigniter 4

// login with email or username codeigniter 4
$admin_credentials = new Admins();

$admin_username = $this->request->getVar('admin_user');
$admin_user = $admin_credentials->where('admin_username', $admin_username)->orWhere('admin_email', $admin_username)->first();

// in SQL this will product 
// -> SELECT * FROM tablename WHERE admin_username='' or admin_email =''
IamPseudoX