Laravel Package for the ArCaptcha

Overview

ArCaptcha

Laravel ArCaptcha Package

Latest Stable Version Total Downloads Latest Unstable Version License

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

For PHP integration you can use mohammadv184/arcaptcha package.

List of contents

Installation

You can install the package via composer:

composer require mohammadv184/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

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

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

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 ArCaptcha in Laravel.

Embed Script in Blade

Insert @arcaptchaScript blade directive before closing tag.

You can also use ArCaptcha::getScript().

>
<html>
    <head>
        ...
        @arcaptchaScript
    head>

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().

">
<form>
    @csrf

    ...
    @arcaptchaWidget
    
    {!! ArCaptcha::getWidget() !!}
    <input type="submit">
form>

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();
    }

Credits

License

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

You might also like...
laravel-vat is a package that contains the Laravel related wiring code for ibericode/vat

laravel-vat is a package that contains the Laravel related wiring code for ibericode/vat, helping you deal with VAT legislation for businesses based in the EU.

Laravel Backup Panel provides a dashboard for spatie/laravel-backup package.
Laravel Backup Panel provides a dashboard for spatie/laravel-backup package.

Laravel Backup Panel Laravel Backup Panel provides a dashboard for spatie/laravel-backup package. It lets you: create a backup (full | only database |

Laravel package to find performance bottlenecks in your laravel application.
Laravel package to find performance bottlenecks in your laravel application.

Laravel Meter Laravel Meter monitors application performance for different things such as requests, commands, queries, events, etc and presents result

Laravel 2-Step Verification is a package to add 2-Step user authentication to any Laravel project easily.
Laravel 2-Step Verification is a package to add 2-Step user authentication to any Laravel project easily.

Laravel 2-Step verification is a package to add 2-Step user authentication to any Laravel project easily. It is configurable and customizable. It uses notifications to send the user an email with a 4-digit verification code. Laravel 2-Step Authentication Verification for Laravel. Can be used in out the box with Laravel's authentication scaffolding or integrated into other projects.

This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files.

Laravel FFMpeg This package provides an integration with FFmpeg for Laravel 6.0 and higher. Laravel's Filesystem handles the storage of the files. Lau

 Laravel Users | A Laravel Users CRUD Management Package
Laravel Users | A Laravel Users CRUD Management Package

A Users Management Package that includes all necessary routes, views, models, and controllers for a user management dashboard and associated pages for managing Laravels built in user scaffolding. Built for Laravel 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6.0, 7.0 and 8.0.

Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with Firebase Cloud Messaging (FCM).

Laravel-FCM Introduction Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with Firebase Cloud M

Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.

Webdevetc BlogEtc - Complete Laravel Blog Package Quickly add a blog with admin panel to your existing Laravel project. It has everything included (ro

Laravel-Mediable is a package for easily uploading and attaching media files to models with Laravel 5.

Laravel-Mediable Laravel-Mediable is a package for easily uploading and attaching media files to models with Laravel. Features Filesystem-driven appro

Releases(v1.1.0)
Owner
Mohammad Abbasi
PHP & Laravel developer
Mohammad Abbasi
A Laravel chat package. You can use this package to create a chat/messaging Laravel application.

Chat Create a Chat application for your multiple Models Table of Contents Click to expand Introduction Installation Usage Adding the ability to partic

Tinashe Musonza 931 Dec 24, 2022
This package provides extended support for our spatie/enum package in Laravel.

Laravel support for spatie/enum This package provides extended support for our spatie/enum package in Laravel. Installation You can install the packag

Spatie 264 Dec 23, 2022
Testbench Component is the de-facto package that has been designed to help you write tests for your Laravel package

Laravel Testing Helper for Packages Development Testbench Component is the de-facto package that has been designed to help you write tests for your La

Orchestra Platform 1.9k Dec 29, 2022
🥳🔐 This package is a Laravel package that checks if an email address is a spammer

This package is a Laravel package that checks if an email address is a spammer. It verifies your signups and form submissions to confirm that they are legitimate.

Endurance, the Martian 15 Dec 19, 2022
GeoLocation-Package - This package helps you to know the current language of the user, the country from which he is browsing, the currency of his country, and also whether he is using it vpn

GeoLocation in PHP (API) ?? ?? ?? This package helps you to know a lot of information about the current user by his ip address ?? ?? ?? This package h

Abdullah Karam 4 Dec 8, 2022
Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

Laravel User Activity Log - a package for Laravel 8.x that provides easy to use features to log the activities of the users of your Laravel app

null 9 Dec 14, 2022
List of 77 languages for Laravel Framework 4, 5, 6, 7 and 8, Laravel Jetstream , Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova and Laravel Spark.

Laravel Lang In this repository, you can find the lang files for the Laravel Framework 4/5/6/7/8, Laravel Jetstream , Laravel Fortify, Laravel Cashier

Laravel Lang 6.9k Jan 2, 2023
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Ollie Codes 19 Jul 5, 2021
A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic

A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic! concepts like , Hijri Dates & Arabic strings and so on ..

Adnane Kadri 49 Jun 22, 2022
A Laravel package that adds a simple image functionality to any Laravel model

Laraimage A Laravel package that adds a simple image functionality to any Laravel model Introduction Laraimage served four use cases when using images

Hussein Feras 52 Jul 17, 2022