PHPackages                             afatmustafa/filamentv3-turnstile - 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. afatmustafa/filamentv3-turnstile

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

afatmustafa/filamentv3-turnstile
================================

A plugin to help you implement the Cloudflare Turnstile into your Filament panels.

v1.2(1y ago)1525.8k↓42.3%5[1 issues](https://github.com/afatmustafa/filamentv3-turnstile/issues)MITPHPPHP ^8.1

Since Aug 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/afatmustafa/filamentv3-turnstile)[ Packagist](https://packagist.org/packages/afatmustafa/filamentv3-turnstile)[ Docs](https://github.com/afatmustafa/filamentv3-turnstile)[ GitHub Sponsors](https://github.com/afatmustafa)[ RSS](/packages/afatmustafa-filamentv3-turnstile/feed)WikiDiscussions 3.x Synced 1mo ago

READMEChangelog (3)Dependencies (10)Versions (4)Used By (0)

Cloudflare Turnstile Integration for Filament V3
================================================

[](#cloudflare-turnstile-integration-for-filament-v3)

A plugin to help you implement the Cloudflare Turnstile into your Filament panels.

[![Latest Version on Packagist](https://camo.githubusercontent.com/323eed5118f20e3654a2e252a4aafe5cf0e33c072c510ccf381703fd2a2d8cad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616661746d7573746166612f66696c616d656e7476332d7475726e7374696c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/afatmustafa/filamentv3-turnstile)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a4dc497bd40bb12f7dbd535d7d5cfe5a4ae3189b08d61e4e773b8ae7570c82d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616661746d7573746166612f66696c616d656e7476332d7475726e7374696c652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/afatmustafa/filamentv3-turnstile/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/293cfd1de38353f32b4f27dd4d010b6ac9bcda8a46103aa3329001292f93a4de/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616661746d7573746166612f66696c616d656e7476332d7475726e7374696c652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/afatmustafa/filamentv3-turnstile/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/91c37260a28bbf3a17591d9ac7161221d4b48e6d542e6b89312c8b91ad0f46c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616661746d7573746166612f66696c616d656e7476332d7475726e7374696c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/afatmustafa/filamentv3-turnstile)

[![Filament V3 Cloudflare Turnstile Integration](https://raw.githubusercontent.com/afatmustafa/filamentv3-turnstile/3.x/art/afatmustafa-filamentv3-turnstile.jpg)](https://raw.githubusercontent.com/afatmustafa/filamentv3-turnstile/3.x/art/afatmustafa-filamentv3-turnstile.jpg)

This extension leverages [Laravel Turnstile](https://github.com/coderflexx/laravel-turnstile) under the hood. For more details, please refer to the **README** on the project page.
Kudos to [coderflexx](https://github.com/coderflexx) for his remarkable work.

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

[](#installation)

You can install the package via composer:

```
composer require afatmustafa/filamentv3-turnstile
```

Getting Started
---------------

[](#getting-started)

To include **Cloudflare Turnstile** in your app, you'll first need to obtain both the `SiteKey` and the `SecretKey` from your [Cloudflare dashboard](https://developers.cloudflare.com/turnstile/get-started/#get-a-sitekey-and-secret-key).

Once you have the **keys**, populate the `TURNSTILE_SITE_KEY` and `TURNSTILE_SECRET_KEY` fields in your `.env` configuration:

```
TURNSTILE_SITE_KEY=2x00000000000000000000AB
TURNSTILE_SECRET_KEY=2x0000000000000000000000000000000AA
```

For testing purposes, Cloudflare offers Dummy site keys and secret keys. Consider using them if needed.

```
TURNSTILE_SITE_KEY=1x00000000000000000000AA
TURNSTILE_SECRET_KEY=1x0000000000000000000000000000000AA
```

More dummy keys, please refer to the [Cloudflare documentation](https://developers.cloudflare.com/turnstile/reference/testing/).

Form Component Usage
--------------------

[](#form-component-usage)

Now using Turnstile is quite simple, all you need to do is follow the code below:

```
use Afatmustafa\FilamentTurnstile\Forms\Components\Turnstile;

    Turnstile::make('turnstile')
        ->theme('light') // Supported themes: light, dark
        ->size('normal') // Supported sizes: normal, compact
        ->language('en-US') // Supported languages: ar-eg,de,en,es,fa,fr,id,it,ja,ko,nl,pl,pt-br,ru,tr,uk,zh-cn and zh-tw
```

Integrating Turnstile Captcha to Filament's Login Page
------------------------------------------------------

[](#integrating-turnstile-captcha-to-filaments-login-page)

To seamlessly integrate the Turnstile captcha with the login page in Filament, follow these steps:

1. Create a new `Login` class under the `app/Filament\Pages\Auth` directory, and extend it from the `Filament\Pages\Auth\Login` class.
    Override the `form` method, and add the `Turnstile` component to the form schema.

```
namespace App\Filament\Pages\Auth;

use Filament\Forms\Form;
use Afatmustafa\FilamentTurnstile\Forms\Components\Turnstile;

class Login extends \Filament\Pages\Auth\Login
{
    public function form(Form $form): Form
    {
        return $form
            ->schema([
                $this->getEmailFormComponent(),
                $this->getPasswordFormComponent(),
                $this->getRememberFormComponent(),
                Turnstile::make('turnstile')
                    ->theme('light')
                    ->size('normal')
                    ->language('en-US'),
            ])
            ->statePath('data');
    }
}
```

2\. In your `PanelProvider` file, override the `login` method, and return the newly created `Login` class.

```
namespace App\Providers\Filament;

...
use App\Filament\Pages\Auth\Login;
...

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->default()
            ->id('admin')
            ->path('app')
            ->login(Login::class)
            ...
    }
}
```

3\. That's it! You should now see the Turnstile captcha on the login page. [![Login Page Demo](https://raw.githubusercontent.com/afatmustafa/filamentv3-turnstile/3.x/art/login-page-demo.jpg)](https://raw.githubusercontent.com/afatmustafa/filamentv3-turnstile/3.x/art/login-page-demo.jpg)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Mustafa Afat](https://github.com/afatmustafa)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance42

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.1% 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 ~187 days

Total

4

Last Release

447d ago

Major Versions

v1.1 → 3.x-dev2025-02-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/59372593?v=4)[Mustafa Afat](/maintainers/afatmustafa)[@afatmustafa](https://github.com/afatmustafa)

---

Top Contributors

[![afatmustafa](https://avatars.githubusercontent.com/u/59372593?v=4)](https://github.com/afatmustafa "afatmustafa (27 commits)")[![DariusIII](https://avatars.githubusercontent.com/u/3399658?v=4)](https://github.com/DariusIII "DariusIII (2 commits)")

---

Tags

laravelcloudflarefilamentfilament-pluginturnstileafatmustafafilamentv3-turnstile

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/afatmustafa-filamentv3-turnstile/health.svg)

```
[![Health](https://phpackages.com/badges/afatmustafa-filamentv3-turnstile/health.svg)](https://phpackages.com/packages/afatmustafa-filamentv3-turnstile)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k1.7M41](/packages/jeffgreco13-filament-breezy)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

254255.2k6](/packages/croustibat-filament-jobs-monitor)[dutchcodingcompany/filament-socialite

Social login for Filament through Laravel Socialite

213914.9k9](/packages/dutchcodingcompany-filament-socialite)[andrewdwallo/filament-companies

A comprehensive Laravel authentication and authorization system designed for Filament, focusing on multi-tenant company management.

34450.0k2](/packages/andrewdwallo-filament-companies)[diogogpinto/filament-auth-ui-enhancer

This Filament plugin empowers you to transform your auth pages with ease, allowing you to make them truly stand out. It offers a flexible alternative to the default auth pages in the Filament Panels package.

13493.9k6](/packages/diogogpinto-filament-auth-ui-enhancer)

PHPackages © 2026

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