PHPackages                             ossycodes/friendlycaptcha - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. ossycodes/friendlycaptcha

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

ossycodes/friendlycaptcha
=========================

A simple package to help integrate FriendlyCaptcha in your Laravel applications.

v3.0.0(1y ago)2018.0k↓14.3%7[1 PRs](https://github.com/ossycodes/friendlycaptcha/pulls)MITPHPPHP ^7.4|^8.0|^8.1|^8.2|^8.3CI passing

Since Oct 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ossycodes/friendlycaptcha)[ Packagist](https://packagist.org/packages/ossycodes/friendlycaptcha)[ Docs](https://github.com/ossycodes/friendlycaptcha)[ RSS](/packages/ossycodes-friendlycaptcha/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (15)Used By (0)

A simple package to help integrate FriendlyCaptcha.
===================================================

[](#a-simple-package-to-help-integrate-friendlycaptcha)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d81c14c67b7570c4c2b3b3275454b70163953079d2f2825c752124535996e068/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f737379636f6465732f667269656e646c79636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ossycodes/friendlycaptcha)[![Total Downloads](https://camo.githubusercontent.com/46900c414840813c50458e3d7a35c0e3b25fdcbe335e7d298eaeee670d14b5e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f737379636f6465732f667269656e646c79636170746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ossycodes/friendlycaptcha)[![GitHub Actions](https://github.com/ossycodes/friendlycaptcha/actions/workflows/main.yml/badge.svg)](https://github.com/ossycodes/friendlycaptcha/actions/workflows/main.yml/badge.svg)

This package helps in setting up and validating FriendlyCaptcha widget and response in your Laravel applications

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

[](#installation)

You can install the package via composer:

```
composer require ossycodes/friendlycaptcha
```

### Configuration

[](#configuration)

Add `FRIENDLY_CAPTCHA_SECRET`, `FRIENDLY_CAPTCHA_SITEKEY` and optional `FRIENDLY_CAPTCHA_PUZZLE_ENDPOINT`, `FRIENDLY_CAPTCHA_VERIFY_ENDPOINT` in **.env** file :

```
FRIENDLY_CAPTCHA_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
FRIENDLY_CAPTCHA_SITEKEY=XXXXXXXXXXXXXXXX
FRIENDLY_CAPTCHA_PUZZLE_ENDPOINT=https://api.friendlycaptcha.com/api/v1/puzzle #optional
FRIENDLY_CAPTCHA_VERIFY_ENDPOINT=https://api.friendlycaptcha.com/api/v1/siteverify #optional

```

You can obtain your site-key from [here](https://docs.friendlycaptcha.com/#/installation?id=_1-generating-a-sitekey) and secret from [here](https://apiserver-prod.friendlycaptcha.eu/dashboard/accounts/1118678876/apikeys)

Usage
-----

[](#usage)

For FriendlyCaptcha widget scripts from a CDN, add the Blade directive `@friendlyCaptchaRenderWidgetScripts` in your layout file. This should be added to the `` of your document.

```

        @friendlyCaptchaRenderWidgetScripts()

        {{ $slot }}

```

or if you don't want to use the Blade directive you can do this instead

```
 {!! FriendlyCaptcha::renderWidgetScripts() !!}
```

You have two options on how to add the script tag either from unpkg (default) or from jsdelivr

`@friendlyCaptchaRenderWidgetScripts()`or `@friendlyCaptchaRenderWidgetScripts('jsdelivr')`

`{!! FriendlyCaptcha::renderWidgetScripts() !!}`or `{!! FriendlyCaptcha::renderWidgetScripts('jsdelivr') !!}`

You can also host the FriendlyCaptcha widget scripts yourself:

```
npm install --save friendly-challenge@0.9.9

```

And import it in your app:

```
import "friendly-challenge/widget";
```

Once that's done, you can call the `renderWidget()` method in `` to output the appropriate markup (friendlycaptcha widget) with your site key configured.

```

    {!! FriendlyCaptcha::renderWidget() !!}

    or with custom theme

    {!! FriendlyCaptcha::renderWidget(['dark-theme' => true]) !!}

    or with custom language

    {!! FriendlyCaptcha::renderWidget(['data-lang' => 'en']) !!}

        Submit

```

Finally On the server, use the provided validation rule to validate the CAPTCHA response.

```
use Illuminate\Validation\Rule;

public function submit(Request $request)
{
    $request->validate([
        'frc-captcha-solution' => ['required', Rule::friendlycaptcha()],
    ]);
}
```

If you prefer to not use a macro, you can resolve an instance of the rule from the container via dependency injection or the `app()` helper.

```
use Ossycodes\FriendlyCaptcha\Rules\FriendlyCaptcha;

public function submit(Request $request, FriendlyCaptcha $friendlyCaptcha)
{
    $request->validate([
        'frc-captcha-solution' => ['required', $friendlyCaptcha],
    ]);
}
```

```
use Ossycodes\FriendlyCaptcha\Rules\FriendlyCaptcha;

public function submit(Request $request)
{
    $request->validate([
        'frc-captcha-solution' => ['required', app(FriendlyCaptcha::class)],
    ]);
}
```

### Testing

[](#testing)

```
composer test
```

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Osaigbovo Emmanuel](https://github.com/ossycodes)
- [Julian Dorn](https://github.com/wi-wissen)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

How do I say Thank you?
-----------------------

[](#how-do-i-say-thank-you)

Please buy me a cup of coffee  , Leave a star and follow me on [Twitter](https://twitter.com/ossycodes) .

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance49

Moderate activity, may be stable

Popularity36

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 95.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

Every ~116 days

Recently: every ~213 days

Total

9

Last Release

375d ago

Major Versions

v1.5.0 → v2.02023-02-19

v2.1.0 → v3.0.02025-05-08

PHP version history (2 changes)1.0.0PHP ^7.4|^8.0

v3.0.0PHP ^7.4|^8.0|^8.1|^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/82932703b154706ffc400d8319ed794db6567b1c2cb4f862cde814b0e442b88f?d=identicon)[ossycodes](/maintainers/ossycodes)

---

Top Contributors

[![ossycodes](https://avatars.githubusercontent.com/u/55060799?v=4)](https://github.com/ossycodes "ossycodes (60 commits)")[![wi-wissen](https://avatars.githubusercontent.com/u/27862749?v=4)](https://github.com/wi-wissen "wi-wissen (3 commits)")

---

Tags

laravelcaptchafriendlycaptcha

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ossycodes-friendlycaptcha/health.svg)

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

###  Alternatives

[anhskohbo/no-captcha

No CAPTCHA reCAPTCHA For Laravel.

1.8k8.5M33](/packages/anhskohbo-no-captcha)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[buzz/laravel-google-captcha

Google captcha for Laravel

2071.1M2](/packages/buzz-laravel-google-captcha)[rahul900day/laravel-captcha

Different types of Captcha implementation for Laravel Application.

10715.9k](/packages/rahul900day-laravel-captcha)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)[rvxlab/hcaptcha

hCaptcha for Laravel

237.2k](/packages/rvxlab-hcaptcha)

PHPackages © 2026

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