PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Naif Alshaye   ChatGPT Laravel Validation for Form Inputs   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: ChatGPT Laravel Validation for Form Inputs
Validate form inputs using artificial intelligence
Author: By
Last change:
Date: 6 months ago
Size: 1,831 bytes
 

Contents

Class file image Download

AI Validation

AI Validator for Laravel: Uses ChatGPT (GPT-3.5-turbo) to easily check and filter user inputs.

Requirements

  • PHP 7.2 or higher
  • Laravel 6.0 or higher
  • Open AI API Key

Installation

You can install the package into a Laravel app via composer:

composer require naif/ai-validation

Publish config file

php artisan vendor:publish --provider="Naif\AIValidation\AIValidationServiceProvider" 

OpenAI API Key

Create your API Key from https://platform.openai.com/api-keys

Add API Key in .env file

CHATGPT_API_KEY=

Usage

Field validation rule

use Naif\AIValidation\Rules\AIValidation;

$request->validate([
    'field_name' => [AIValidation::make('ads')],
]);

Supported Validation Types

  • Spam: Identifies unsolicited, bulk, or irrelevant messages.
  • Nonsense: Flags text that is illogical or meaningless.
  • Botcheck: Detects text likely generated by automated bots.
  • Emoji Overuse: Catches excessive use of emojis in text.
  • Promotional: Highlights promotional or advertising content.
  • Ads: Identifies content that is explicitly advertising.
  • Swearing: Flags use of profanity or offensive language.
  • Hate Speech: Detects speech that promotes hate or discrimination.
  • Political Bias: Identifies politically biased or partisan content.
  • Adult Content: Flags explicit or sexually suggestive content.
  • Secure: Checks for content with potential security risks.
  • Phishing: Identifies attempts to acquire sensitive information.
  • Personal Info: Detects the presence of private personal data.

Support:

naif@naif.io

https://naif.io

Bug Tracker:

https://github.com/naifalshaye/ai-validation/issues/new

License

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