承接 hirenkeraliya/lara-captcha 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hirenkeraliya/lara-captcha

最新稳定版本:2.1

Composer 安装命令:

composer require hirenkeraliya/lara-captcha

包简介

Laravel custom recaptcha.

README 文档

README

Laravel Captcha (Laravel 9.x)

Lara-Captcha is a reliable and easy-to-use package for preventing bot submissions and enhancing the security of public forms in Laravel. With its simple integration and multiple customization options, it's a great choice for developers looking to improve the safety of their forms.

Requirements

PHP Laravel Package
8.1+ 9.x v1.0.0

Features

  • Easy integration with Laravel forms
  • Supports multiple configurations for customization
  • Provides effective protection against bot submissions
  • Minimal code changes required for implementation
  • Regular updates and bug fixes from the author
  • Lightweight package for efficient performance

Usage

Here's an example of how to use Lara-Captcha in your Laravel form:

  <form method="POST" action="/submit-form">
    @csrf
    @captcha

    <input type="text" name="name" placeholder="Name"><br>
    <input type="email" name="email" placeholder="Email"><br>
    <button type="submit">Submit</button>
  </form>

Installation

Follow these steps to install the package:

  1. Run the following command in your terminal/cmd:
composer require hirenkeraliya/lara-captcha
  1. Import the configuration file by running this command in your terminal/cmd:
php artisan vendor:publish --tag=lara-captcha-config
  1. Add @captcha in your form after the CSRF token.

  2. To use the middleware, add the following line to your route:

use Hirenkeraliya\LaraCaptcha\app\Http\Middleware\VerifyCaptcha;

Route::post('contact-us', [ContactUsController::class, 'index'])->name('front.contact_us')->middleware(VerifyCaptcha::class);

or You can apply it to multiple routes by utilizing route grouping.

use Hirenkeraliya\LaraCaptcha\app\Http\Middleware\VerifyCaptcha;

Route::group(['middleware' => VerifyCaptcha::class], function () {
  Route::post('contact-us', [ContactUsController::class, 'index'])->name('front.contact_us');
});

Route::middleware([VerifyCaptcha::class])->group(function () {
  Route::post('contact-us', [ContactUsController::class, 'index'])->name('front.contact_us');
});

That's it! Your form is now secured against bot submissions.

Configuration

Lara-Captcha provides multiple configuration options that you can modify to fit your needs. The default configuration can be found in the config/lara-captcha.php file after running the vendor:publish command.

You can modify the following configuration options:

  • enabled: The validation can be enabled or disabled.
  • input_name: The name of the input field in your form.
  • error.message: The error message to display when a bot submission is detected.
  • error.status_code: The error status code to display when a bot submission is detected.

Authors

Support

If you encounter any issues with Lara-Captcha or have suggestions for improvement, feel free to open an issue on the GitHub repository.

Contributing

Contributions to Lara-Captcha are always welcome! To contribute, simply fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details

Special Thanks to

Special thanks to the Laravel community for their support

统计信息

  • 总下载量: 34
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 25
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 25
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固