PHPackages                             novay/icaptcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. novay/icaptcha

ActiveLaravel-package[Security](/categories/security)

novay/icaptcha
==============

Custom Image Captcha Package for Laravel.

1.0.0(5mo ago)02MITPHP

Since Nov 26Pushed 5mo agoCompare

[ Source](https://github.com/novay/icaptcha)[ Packagist](https://packagist.org/packages/novay/icaptcha)[ RSS](/packages/novay-icaptcha/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

🤖 Laravel Icaptcha
==================

[](#-laravel-icaptcha)

[](https://www.google.com/search?q=https://packagist.org/packages/novay/icaptcha)[](https://www.google.com/search?q=https://packagist.org/packages/novay/icaptcha)[](https://www.google.com/search?q=https://github.com/novay/icaptcha/blob/main/LICENSE)

Package **Laravel Icaptcha** menyediakan solusi keamanan berbasis *image CAPTCHA* yang fleksibel untuk aplikasi Laravel Anda. Icaptcha menawarkan berbagai tipe tantangan (teks, matematika, dan pengetahuan umum) dan mudah diintegrasikan menggunakan **Blade Directive** sederhana.

---

✨ Fitur Utama
-------------

[](#-fitur-utama)

- **Tiga Tipe Tantangan:** Mendukung Captcha **Teks Acak**, **Matematika Sederhana**, dan **Tebak Nama Kota** (pengetahuan umum).
- **Kustomisasi *Runtime*:** Konfigurasi dapat ditimpa langsung di *view* Anda.
- **Validasi Satu Kali Pakai (*One-Time Use*):** Jawaban Captcha dihapus dari *session* segera setelah validasi untuk keamanan.
- ***Noise* dan Rotasi:** Teks dan gambar diacak untuk mencegah *bot* OCR (*Optical Character Recognition*).
- **Modularitas:** Menggunakan *view* dan *data* yang dapat dipublikasikan untuk kustomisasi mudah.

---

🚀 Instalasi
-----------

[](#-instalasi)

### 1. Instalasi Composer

[](#1-instalasi-composer)

```
composer require novay/icaptcha
```

### 2. Publikasi Aset

[](#2-publikasi-aset)

Setelah instalasi, jalankan perintah *publish* untuk menyalin *config*, *view*, dan data ke direktori aplikasi Anda:

```
php artisan vendor:publish --tag=icaptcha-config  # [config/icaptcha.php]
php artisan vendor:publish --tag=icaptcha-views   # [resources/views/vendor/icaptcha/icaptcha.blade.php]
php artisan vendor:publish --tag=icaptcha-data    # [storage/app/vendor/icaptcha/cities.json]
```

> **Disarankan:** Periksa dan sesuaikan pengaturan di `config/icaptcha.php` sesuai kebutuhan Anda, terutama *path font* dan dimensi gambar.

---

🔑 Penggunaan
------------

[](#-penggunaan)

### 1. Menampilkan Captcha di View

[](#1-menampilkan-captcha-di-view)

Gunakan **Blade Directive** `@icaptcha` di mana pun Anda membutuhkan kode keamanan (biasanya di formulir login atau pendaftaran).

```

    Kode Keamanan

        @icaptcha

```

### 2. Kustomisasi Tipe Captcha (*Runtime*)

[](#2-kustomisasi-tipe-captcha-runtime)

Anda dapat menimpa tipe dan parameter konfigurasi Captcha langsung saat pemanggilan *directive*:

TipeDeskripsiContoh Pemanggilan`text`Karakter acak dengan rotasi per karakter.`@icaptcha(['length' => 6])``math`Soal aritmatika sederhana.`@icaptcha(['type' => 'math', 'math_operator' => ['+']])``city`Tebak nama kota (vokal disamarkan).`@icaptcha(['type' => 'city'])`---

🔒 Validasi Jawaban
------------------

[](#-validasi-jawaban)

Gunakan aturan validasi `icaptcha` yang disediakan oleh *package* di *Request* atau *Controller* Anda.

```
// Dalam FormRequest atau Controller

public function store(Request $request)
{
    $request->validate([
        // ... aturan validasi lainnya
        'icaptcha' => 'required|icaptcha',
    ], [
        'icaptcha.required' => 'Mohon masukkan kode keamanan.',
        'icaptcha.icaptcha' => 'Jawaban kode keamanan tidak tepat.',
    ]);

    // ... Logika login atau pendaftaran berhasil
}
```

> **Perhatian:** Aturan `icaptcha` secara otomatis mengambil jawaban yang benar dari *session*, membandingkannya dengan input pengguna, dan **menghapus kunci *session*** setelah validasi.

---

⚙️ Detail Konfigurasi
---------------------

[](#️-detail-konfigurasi)

Berikut adalah kunci-kunci penting di `config/icaptcha.php`:

KunciTipeDeskripsiDefault`type``string`Tipe Captcha: `'text'`, `'math'`, atau `'city'`.`'text'``session_key``string`Kunci yang digunakan untuk menyimpan jawaban di *session*.`'icaptcha_code'``width``int`Lebar gambar Captcha (piksel).`180``height``int`Tinggi gambar Captcha (piksel).`50``font_path``string`Path ke file font TTF yang digunakan.*Path default*`math_operator``array`Operator yang digunakan untuk tipe `math` (e.g., `['+', '-']`).`['+', '-']`---

### Lisensi

[](#lisensi)

Package ini dirilis di bawah [Lisensi MIT](https://www.google.com/search?q=https://github.com/novay/icaptcha/blob/main/LICENSE).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance70

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

173d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/712577?v=4)[Novianto Rahmadi](/maintainers/novay)[@novay](https://github.com/novay)

---

Top Contributors

[![novay](https://avatars.githubusercontent.com/u/712577?v=4)](https://github.com/novay "novay (2 commits)")

### Embed Badge

![Health badge](/badges/novay-icaptcha/health.svg)

```
[![Health](https://phpackages.com/badges/novay-icaptcha/health.svg)](https://phpackages.com/packages/novay-icaptcha)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
