承接 atendwa/laravel-honeypot 相关项目开发

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

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

atendwa/laravel-honeypot

最新稳定版本:1.1.2

Composer 安装命令:

composer require atendwa/laravel-honeypot

包简介

This Laravel package safeguards your forms effortlessly with an invisible shield against spam, featuring seamless integration and configurable settings for optimal protection.

README 文档

README

Latest Version on Packagist Software License

run-tests Quality Score Code Style Status

Laravel Honeypot is a package designed to help protect your Laravel applications from spam bots by adding a hidden form field that, when filled, indicates the submission is likely from a bot. It provides a simple and effective method to reduce spam submissions without inconveniencing genuine users.

Installation

You can install the package via composer:

composer require atendwa/laravel-honeypot

Configuration

You can override the default options for the honeypot. First publish the honeypot.php configuration file:

  php artisan vendor:publish --provider="Atendwa\Honeypot\HoneypotServiceProvider" --tag="config"

Add the following variables in your .env file to use you custom configurations

HONEYPOT_ENABLED=TRUE

HONEYPOT_INPUT_NAME=mobile

HONEYPOT_TIME_INPUT_NAME=time_field

HONEYPOT_MINIMUM_SUBMISSION_DURATION=1 #time in seconds

Usage

  1. Add the prevent-spam middleware to the routes you want to protect from spam bots.

    Route::post('/submit-comment', [commentController::class, 'store'])
        ->middleware('prevent-spam');
  2. Add the <x-honeypot::honeypot-fields/> blade component to the form body

    <form action="/submit-comment" method="POST">
        @csrf
    
        <x-honeypot::honeypot-fields/>
        
        // other input fields
    </form>

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email tendwa.am@gmail.com instead of using the issue tracker.

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-03