Filament Plugin to help implement Cloudflare turnstile into your forms.

Overview

Filament Turnstile

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads


Login Screen screenshot


Filament Turnstile, is a plugin to help you implement the Cloudflare turnstile.

This plugin uses Laravel Turnstile Behind the scene, you can head to the page README to learn more.

Installation

You can install the package via composer:

composer require coderflex/filament-turnstile

Turnstile Keys

To be able to use Cloudflare Turnstile, you need to get the SiteKey, and the SecretKey from your Cloudflare dashboard

After Generating the keys, use TURNSTILE_SITE_KEY, and TURNSTILE_SECRET_KEY in your .env file

TURNSTILE_SITE_KEY=2x00000000000000000000AB
TURNSTILE_SECRET_KEY=2x0000000000000000000000000000000AA

If you want to test the widget, you can use the Dummy site keys and secret keys that Cloudflare provides.

Usage

The usage of this plugin, is really straight - forward. In your form, use the following code:

...
use Coderflex\FilamentTurnstile\Forms\Components\Turnstile;

...
    Turnstile::make('captcha')
        ->theme('auto')
        ->language('fr')
        ->size('normal'),

The Turnstile field, has few options to use. You can learn more about them in the Cloudflare configuration section

Real Life Example:

In order to use Turnstile captcha with the Login page in filament, use the following steps:

Create a new App/Filament/Pages/Login.php class

<?php

namespace App\Filament\Pages;

use Coderflex\FilamentTurnstile\Forms\Components\Turnstile;

class Login extends \Filament\Http\Livewire\Auth\Login
{
    protected function getFormSchema(): array
    {
        return array_merge(
            parent::getFormSchema(),
            [
                Turnstile::make('cf-captcha')
                    ->theme('auto')
                    ->language('en-US')
                    ->size('normal'),
            ]
        );
    }
}

Then override the Login class in the filament.php config file.

    return [
        ....
        'auth' => [
            'guard' => env('FILAMENT_AUTH_GUARD', 'web'),
            'pages' => [
                'login' => \App\Filament\Pages\Login::class,
            ],
        ],
        ...
    ]

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see the License File for more information.

You might also like...
Add a general-purpose tools page to your Filament project. 🛠
Add a general-purpose tools page to your Filament project. 🛠

Add a general-purpose tools page to your Filament project. Installation You can install the package via Composer: composer require ryangjchandler/fila

Easily interact and control your feature flags from Filament

Easily interact and control your feature flags from Filament

Add a progress bar column to your Filament tables.
Add a progress bar column to your Filament tables.

Add a progress bar column to your Filament tables. This package provides a ProgessColumn that can be used to display a progress bar in a Filament tabl

Manage your own workflows with filament
Manage your own workflows with filament

Filament Workflow Manager This package provides a Filament resource where you can configure and manager your workflows, and also provides some functio

A package to implement repository pattern for laravel models

Laravel Model UUID A simple package to use Repository Pattern approach for laravel models . Repository pattern Repositories are classes or components

A Laravel 8 Project Implement with GraphQL With Sanctum APIs Authentications Which utilized in Any Frontend or Any Mobile Application Programs.

A Laravel 8 Project Implement with GraphQL With Sanctum APIs Authentications Which utilized in Any Frontend or Any Mobile Application Programs.

Cascading deletes for Eloquent models that implement soft deletes

Cascading soft deletes for the Laravel PHP Framework Introduction In scenarios when you delete a parent record - say for example a blog post - you may

Laminas\Console is a component to design and implement console applications in PHP.

laminas-console This package is abandoned and will receive no further development! We recommend using laminas/laminas-cli. Laminas\Console is a compon

Twitter Bootstrap forms for Laravel 5

Twitter Bootstrap Forms for Laravel 5 Simple way to create forms View demo demo repository Custom form controls and shorthand methods for form rows (b

Releases(v1.0.0)
Owner
Coderflex
Full Stack web development Company
Coderflex
Filament-spatie-laravel-activitylog - View your activity logs inside of Filament. ⚡️

View your activity logs inside of Filament. This package provides a Filament resource that shows you all of the activity logs created using the spatie

Ryan Chandler 45 Dec 26, 2022
A convenient helper for using the laravel-seo package with Filament Admin and Forms

Combine the power of Laravel SEO and Filament PHP. This package is a convenient helper for using the laravel-seo package with Filament Admin and Forms

Ralph J. Smit 39 Dec 21, 2022
Provides the missing range field for the Filament forms.

The missing range field for the Filament forms. Installation You can install the package via composer: composer require yepsua/filament-range-field Pu

null 11 Sep 10, 2022
A demo of how to use filament/forms to build a user-facing Form Builder which stores fields in JSON.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Dan Harrin 41 Dec 24, 2022
Your users do not always report errors, LaraBug does. LaraBug is a simple to use and implement error tracker built for the Laravel framework.

Your users do not always report errors, LaraBug does. LaraBug is a simple to use and implement error tracker built for the Laravel framework. This rep

LaraBug 197 Dec 9, 2022
Vandar Cashier is a Laravel package that allows you to seamlessly implement IPG and Direct Debit on your application

Vandar Cashier is a Laravel package that provides you with a seamless integration with Vandar services. Take a look at Vandar Documentation for more i

Vandar 11 Dec 14, 2022
Keeping Your Laravel Forms Awake.

Caffeine for Laravel Supporting This Package This is an MIT-licensed open source project with its ongoing development made possible by the support of

GeneaLabs, LLC 839 Dec 22, 2022
A media picker plugin for Filament Admin.

Filament Curator A media picker plugin for Filament Admin. ‼️ This package is still in development ‼️ This package does not work with Spatie Media Lib

Adam Weston 84 Jan 7, 2023
Plugin for Filament Admin that adds a dropdown menu to the header to quickly create new items.

Filament Quick Create Plugin for Filament Admin that adds a dropdown menu to the header to quickly create new items from any page. Installation Instal

Adam Weston 45 Dec 27, 2022
Simple plugin to toggle maintenance mode from Filament.

Filament Maintenance Plugin This plugin allows you to easily toggle maintenance mode from your Filament Admin Panel. You can also set a secret token t

Keysaw 6 Jun 8, 2023