Looking to hire Laravel developers? Try LaraJobs

contextr-for-laravel maintained by jeffreyvanrossum

Description
contextr for laravel
Last update
2025/06/03 15:35 (dev-main)
License
Downloads
6

Comments
comments powered by Disqus

AI-driven text analysis for spam, sentiment, moderation, and more.

Installation

You can install the package via composer:

composer require jeffreyvanrossum/contextr-for-laravel

You can publish the config file with:

php artisan vendor:publish --tag="contextr-config"

Usage

Contextr::spam()
    ->text('Buy cheap viagra now!!! Click here: shady.link')
    ->context([
        'topic' => 'Health Forum Discussion',
        'user_history' => 'First time poster'
    ])
    ->withReasoning()
    ->analyze();

$check->data();         // full result array
$check->spam();         // true (boolean)
$check->confidence();   // 0.95 (float)
$check->reasoning();    // "Contains promotional content and suspicious link"

For more examples, see:

https://github.com/jeffreyvr/contextr?tab=readme-ov-file#examples

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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