PHPackages                             arcaptcha/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. arcaptcha/arcaptcha-laravel

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

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

Laravel Package for the ArCaptcha

1.0.4(1y ago)123.3k↓15.4%2[1 PRs](https://github.com/arcaptcha/arcaptcha-laravel/pulls)MITPHPPHP &gt;=7.3

Since Aug 9Pushed 1y agoCompare

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

READMEChangelogDependencies (4)Versions (7)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

33

—

LowBetter than 72% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

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

Every ~269 days

Total

5

Last Release

713d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/236f1fc4c525e521b0bd85356d7d628d4af2838e21904080bc107c62882a702f?d=identicon)[arcaptcha](/maintainers/arcaptcha)

---

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)")[![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/arcaptcha-arcaptcha-laravel/health.svg)

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

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[carsdotcom/laravel-json-schema

Json Schema validation for Laravel projects

1043.3k6](/packages/carsdotcom-laravel-json-schema)

PHPackages © 2026

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