Download the PHP package gowelle/azure-moderator without Composer

On this page you can find all versions of the php package gowelle/azure-moderator. 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 azure-moderator

Azure Content Safety for Laravel

Tests PHPStan Level 6 Latest Version on Packagist Total Downloads

A Laravel package for content moderation using Azure Content Safety API. This package helps you analyze both text and image content for potentially harmful material, automatically flagging or approving content based on Azure's AI-powered analysis.


Table of Contents


Features

Requirements

Installation

Install the package via composer:

Publish the configuration file:

Configuration

Add your Azure credentials to your .env file:

Configuration Options

Usage

Text Moderation

Basic Usage

Custom Categories

Image Moderation

Basic Image Moderation

Base64 Image Moderation

Note: Base64 images are limited to 4MB of encoded data, which corresponds to approximately 3MB of original image size (due to base64 encoding overhead of ~33%).

Image Moderation with Custom Categories

Laravel Validation

Use the SafeImage validation rule to automatically validate uploaded images:

Error Handling

The package provides flexible error handling to ensure both security and user experience:

Graceful Degradation and Strict Mode

The fail_on_api_error configuration controls how the package behaves when the Azure API is unavailable:

Default Behavior (fail_on_api_error = false):

Strict Mode (fail_on_api_error = true):

Configuration:

Retry Logic: The package includes automatic retry logic with exponential backoff for:

Multimodal Analysis (Preview)

⚠️ Preview API: Uses 2024-09-15-preview. Feature availability varies by Azure region.

Analyze images with associated text for contextual content moderation:

SafeMultimodal Validation Rule

CLI Testing

Multi-Modal Analysis (Batch & Async)

Process multiple items or perform context-aware analysis:

For background processing, dispatch the job:

Custom Blocklists

Manage custom blocklists to filter specific terms.

Use in moderation:

See Blocklists Guide for full details.

Protected Material Detection

Detect copyrighted content in text:

Or use the validation rule:

See Protected Material Guide for details.

Artisan Commands

Test image moderation from the command line:

Testing

This package includes a comprehensive test suite with unit tests, integration tests, and performance benchmarks.

Running Tests

Integration Tests

Integration tests validate the package against the real Azure Content Safety API. To run them:

  1. Copy the example environment file:

  2. Add your Azure credentials to .env.integration:

  3. Run integration tests:

Test Coverage:

See Integration Testing Guide for detailed documentation.

Quality Tools

CI/CD

GitHub Actions automatically runs:

To enable integration tests in CI, add these secrets to your repository:

Documentation

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Please review our Security Policy for more details.

Credits

License

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


All versions of azure-moderator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/support Version ^11.0 || ^12.0 || ^13.0
guzzlehttp/guzzle Version ^7.9
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 gowelle/azure-moderator contains the following files

Loading the files please wait ...