Download the PHP package tigusigalpa/yandex-smartcaptcha-php without Composer

On this page you can find all versions of the php package tigusigalpa/yandex-smartcaptcha-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yandex-smartcaptcha-php

Yandex SmartCaptcha PHP

Yandex SmartCaptcha PHP

License: MIT PHP Version

PHP for Yandex SmartCaptcha with full Laravel support.

Русская версия

Table of Contents

Features

Requirements

Installation

Install via Composer:

Getting Started with Yandex SmartCaptcha

Prerequisites

Before you begin, you need to set up Yandex Cloud and create a captcha:

1. Create Yandex Cloud Account

  1. Go to Yandex Cloud Console
  2. Sign in to Yandex Cloud or register if you haven't already
  3. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status
  4. If you don't have a billing account, create one

2. Create Captcha in Console

  1. In the management console, select your folder
  2. Select Yandex SmartCaptcha service
  3. Click Create captcha
  4. Enter a captcha name. Naming requirements:
    • Length: 2 to 63 characters
    • Can contain lowercase Latin letters, numbers, and hyphens
    • First character must be a letter, last character cannot be a hyphen
  5. (Optional) Disable domain name verification if needed
  6. Specify the list of sites where the captcha will be placed (e.g., example.com)
  7. Leave the appearance as standard
  8. Configure the default captcha:
    • Select the pre-check type (checkbox or slider)
    • Select the challenge type (image-text task)
    • Choose complexity: Easy, Medium, or Hard
  9. (Optional) Enable or disable the use of HTTP request information for ML model training
  10. Click Create

3. Get Captcha Keys

After creating the captcha:

  1. In the management console, select your folder
  2. Select Yandex SmartCaptcha service
  3. Click on the captcha name
  4. On the Overview tab, copy:
    • Client Key (for frontend widget)
    • Server Key (for backend validation)

4. Get OAuth Token (for API management)

To manage captchas via API, you need an OAuth token. The package will automatically exchange it for an IAM token and refresh it when needed.

Get OAuth Token:

Visit the following URL and authorize the application:

After authorization, you'll receive an OAuth token. Copy it and use it in your application.

Note: The package uses tigusigalpa/yandex-cloud-client-php which handles:

Now you have:

Quick Start

Basic Usage (Pure PHP)

Laravel Usage

1. Publish Configuration

2. Configure Environment

Add to your .env:

Note: The package uses yandex-cloud-client-php for authentication. Your OAuth token will be automatically exchanged for an IAM token and refreshed when needed (IAM tokens expire after 12 hours).

3. Use Facade

API Methods

Token Validation

Validate user captcha token:

Create Captcha

Create a new captcha:

Get Captcha

Get captcha information:

List Captchas

List all captchas in folder:

Update Captcha

Update captcha settings:

Delete Captcha

Delete a captcha:

Get Secret Key

Retrieve server secret key:

Frontend Integration

Basic Widget

Add to your HTML:

Advanced Widget

Laravel Validation Rule

Create custom validation rule:

Use in controller:

Error Handling

All exceptions extend SmartCaptchaException:

Logging

Enable logging in Laravel:

Or pass PSR-3 logger in pure PHP:

Testing

Run tests:

With coverage:

Documentation

License

MIT License. See LICENSE for details.

Author

Igor Sazonov

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

  1. Clone the repository:

  2. Install dependencies:

  3. Run tests:

Coding Standards

This project follows PSR-12 coding standards:

Pull Request Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Changelog

[1.0.0] - 2024-11-29

Added:

Support


All versions of yandex-smartcaptcha-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
guzzlehttp/guzzle Version ^7.0|^8.0
ext-json Version *
psr/log Version ^1.0|^2.0|^3.0
tigusigalpa/yandex-cloud-client-php Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tigusigalpa/yandex-smartcaptcha-php contains the following files

Loading the files please wait ...