承接 mlk9/captcha-laravel 相关项目开发

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

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

mlk9/captcha-laravel

Composer 安装命令:

composer require mlk9/captcha-laravel

包简介

image captcha for Laravel 9+

README 文档

README

image captcha for Laravel

  • works with session
  • generates image your custom

Persian Docs for V2 : https://vrgl.ir/WQXCT

Installation

you can install this package via composer

composer require mlk9/captcha-laravel

then publish vendor

php artisan vendor:publish --tag=captcha-laravel

Documents

Configure

  • type (array , [char, math])
  • backgrounds (array)
  • char (string)
  • length (int)
  • font (string|array)
  • colors (array)
  • width (int)
  • height (int)
  • type_hash ([laravel, sha256, md5])

Generate captcha simple

you can use component:

<x-captcha-box /> 
<x-captcha-box-refresh />  //via refresh

or create custom like this:

<div>
    <div>
        <div>
             <!-- Captcha generate -->
            <img src="{{ \Mlk9\Captcha\Facades\Captcha::generate()->image }}" alt="captha"> 
        </div>
  <div>
   <div>{{ __('captcha.captcha') }}</div>
   <input id="captcha" name="captcha" type="text" required autocomplete="off">
  </div>
 </div>
</div>

Validation

You can use captcha rule in your validations

Illuminate\Support\Facades\Validator::validate($request->all(),
    ["captchaField"=>"captcha"]
);

also

you can add middleware captcha to your routes or controllers

and the third way use isValid(string: entry) from \Mlk9\Captcha\Facades\Captcha::class for example :

if(!\Mlk9\Captcha\Facades\Captcha::isValid($request->captcha))
{
    return back()->withErrors('Wrong Captcha');
}

notice for v2

if you get error for font you can replace in config 'font' => public_path('vendor/captcha/fonts/tahoma.ttf'),

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固