PHPackages                             miladshm/arcaptcha-laravel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. miladshm/arcaptcha-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

miladshm/arcaptcha-laravel
==========================

Laravel Package for the ArCaptcha

v1.0(5mo ago)06MITPHPPHP &gt;=7.3

Since Nov 16Pushed 5mo agoCompare

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

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

[![ArCaptcha](resources/images/arcaptcha-logo.png)](resources/images/arcaptcha-logo.png)

Laravel ArCaptcha Package
=========================

[](#laravel-arcaptcha-package)

[![Latest Stable Version](https://camo.githubusercontent.com/2965b9fc92be796e812a5ee79c8c17e0cfc94d0747e1136d74f0c4ac722ecc74/687474703a2f2f706f7365722e707567782e6f72672f6172636170746368612f6172636170746368612d6c61726176656c2f76)](https://packagist.org/packages/arcaptcha/arcaptcha-laravel)[![Total Downloads](https://camo.githubusercontent.com/ddd0dc7fad53c23fb2443230459588d632fd22a527b0cd5112550c28f18b63db/687474703a2f2f706f7365722e707567782e6f72672f6172636170746368612f6172636170746368612d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/arcaptcha/arcaptcha-laravel) [![Latest Unstable Version](https://camo.githubusercontent.com/028480299431bb795192247975028336f86190f50d08e38fbd69c52d0df239a1/687474703a2f2f706f7365722e707567782e6f72672f6172636170746368612f6172636170746368612d6c61726176656c2f762f756e737461626c65)](https://packagist.org/packages/arcaptcha/arcaptcha-laravel)[![License](https://camo.githubusercontent.com/e5c043499a47a331c94ed70144d2938db6186b24d5ec7b254d1c211d4684d737/687474703a2f2f706f7365722e707567782e6f72672f6172636170746368612f6172636170746368612d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/arcaptcha/arcaptcha-laravel)[![PHP Version Require](https://camo.githubusercontent.com/36fe2eeac7f41a2d9a0dde384b9b0752baaba2dc1c464ce68e56b624814749a6/687474703a2f2f706f7365722e707567782e6f72672f6172636170746368612f6172636170746368612d6c61726176656c2f726571756972652f706870)](https://packagist.org/packages/arcaptcha/arcaptcha-laravel)

Laravel Package for the ArCaptcha This package supports `PHP 7.3+`.

For **PHP** integration you can use [mohammadv184/arcaptcha](https://github.com/mohammadv184/arcaptcha) package.

List of contents
================

[](#list-of-contents)

- [PHP ArCaptcha Library](#PHP-ArCaptcha-Library)
- [List of contents](#list-of-contents)
    - [Installation](#Installation)
    - [Configuration](#Configuration)
        - [Publish package](#publish-package)
        - [Set the environment](#set-the-environment)
        - [Customize error message](#customize-error-message)
    - [How to use](#how-to-use)
        - [Embed Script in Blade](#Embed-Script-in-Blade)
        - [Form setup](#Form-setup)
        - [Verify submitted data](#Verify-submitted-data)
    - [Credits](#credits)
    - [License](#license)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require arcaptcha/arcaptcha-laravel
```

Laravel 5.5 (or greater) uses package auto-discovery, so doesn't require you to manually add the Service Provider, but if you don't use auto-discovery ArCaptchaServiceProvider must be registered in config/app.php:

```
'providers' => [
    ...
    Mohammadv184\ArCaptcha\Laravel\ArCaptchaServiceProvider::class,
];
```

You can use the facade for shorter code. Add ArCaptcha to your aliases:

```
'aliases' => [
    ...
    'ArCaptcha' => Mohammadv184\ArCaptcha\Laravel\Facade\ArCaptcha::class,
];
```

Configuration
-------------

[](#configuration)

### Publish package

[](#publish-package)

Create config/arcaptcha.php configuration file using the following artisan command:

```
php artisan vendor:publish --provider="Mohammadv184\ArCaptcha\Laravel\ArCaptchaServiceProvider"
```

### Set the environment

[](#set-the-environment)

Open .env file and set `ARCAPTCHA_SITE_KEY` and `ARCAPTCHA_SECRET_KEY`:

```
# in your .env file
ARCAPTCHA_SITE_KEY=YOUR_API_SITE_KEY
ARCAPTCHA_SECRET_KEY=YOUR_API_SECRET_KEY

# Optional: Default returned value from verify function
# when there is an Network or any other unexpected issue.
ARCAPTCHA_VERIFY_EXCEPTION_VALUE=true
```

### Customize error message

[](#customize-error-message)

Before starting please add the validation message to `resources/lang/[LANG]/validation.php` file

```
return [
    ...
    'arcaptcha' => 'Hey!!! :attribute is wrong!',
];
```

How to use
----------

[](#how-to-use)

How to use ArCaptcha in Laravel.

### Embed Script in Blade

[](#embed-script-in-blade)

Insert `@arcaptchaScript` blade directive before closing `` tag.

You can also use `ArCaptcha::getScript()`.

```
>

    ... @arcaptchaScript

```

### Form setup

[](#form-setup)

After you have to insert `@arcaptchaWidget` blade directive inside the form where you want to use the field `arcaptcha-token`.

You can also use `ArCaptcha::getWidget()`.

*Note : You can pass widget options into getWidget function or arcaptchaWidget directive like this : @arcaptchaWidget(\['lang'=&gt;'en'\])*

*To see available options on widget see [here](https://docs.arcaptcha.ir/docs/configuration#arcaptcha-container-configuration)*

```

  @csrf ... @arcaptchaWidget

  {!! ArCaptcha::getWidget() !!}

```

### Verify submitted data

[](#verify-submitted-data)

Add `arcaptcha` to your rules

```
$validator = Validator::make(request()->all(), [
        ...
        'arcaptcha-token' => 'arcaptcha',
    ]);

    // check if validator fails
    if($validator->fails()) {
        ...
        $errors = $validator->errors();
    }
```

Invisible mode example
----------------------

[](#invisible-mode-example)

Just try to pass `size` and `callback` option to getWidget function. Make sure to define callback function in global scope:

```

  {!! ArCaptcha::getWidget([ 'size'=>'invisible','callback'=>'callback']) !!}

    function callback(token) {
      // Challenge is solved! Just submit the form!
    }

```

Credits
-------

[](#credits)

- [Mohammad Abbasi](https://github.com/mohammadv184)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance70

Regular maintenance activity

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 69.2% 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

178d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f6c0d186c4ff5f00000248742e63e4f89d1d68361715b255d852513075a56723?d=identicon)[miladshm](/maintainers/miladshm)

---

Top Contributors

[![mohammadv184](https://avatars.githubusercontent.com/u/77800167?v=4)](https://github.com/mohammadv184 "mohammadv184 (18 commits)")[![haji4ref](https://avatars.githubusercontent.com/u/11948290?v=4)](https://github.com/haji4ref "haji4ref (5 commits)")[![miladshm](https://avatars.githubusercontent.com/u/68180764?v=4)](https://github.com/miladshm "miladshm (2 commits)")[![darmond157](https://avatars.githubusercontent.com/u/79264860?v=4)](https://github.com/darmond157 "darmond157 (1 commits)")

---

Tags

laravellaravel-packagecaptchaphp captchalaravel-captchaarcaptchapersian-captcha

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/miladshm-arcaptcha-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/miladshm-arcaptcha-laravel/health.svg)](https://phpackages.com/packages/miladshm-arcaptcha-laravel)
```

###  Alternatives

[arcaptcha/arcaptcha-laravel

Laravel Package for the ArCaptcha

123.2k](/packages/arcaptcha-arcaptcha-laravel)[realrashid/sweet-alert

Laravel Sweet Alert Is A Package For Laravel Provides An Easy Way To Display Alert Messages Using The SweetAlert2 Library.

1.2k2.9M21](/packages/realrashid-sweet-alert)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[imanghafoori/laravel-nullable

A package to help you write expressive defensive code in a functional manner

151423.7k6](/packages/imanghafoori-laravel-nullable)[fresns/plugin-manager

Enhance Laravel Apps: Organized &amp; Scalable

523.2k2](/packages/fresns-plugin-manager)[paxha/laravel-reportable

This Laravel Eloquent extension provides record according to dates using models.

111.2k](/packages/paxha-laravel-reportable)

PHPackages © 2026

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