PHPackages                             ahmedash95/sentimento - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ahmedash95/sentimento

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ahmedash95/sentimento
=====================

A laravel package that provides sentiment analysis capabilities using OpenAI's GPT to easily analyze text-based data and gain insight into the underlying sentiment.

0.0.2(3y ago)31393MITPHPCI passing

Since Mar 10Pushed 1y ago2 watchersCompare

[ Source](https://github.com/ahmedash95/sentimento)[ Packagist](https://packagist.org/packages/ahmedash95/sentimento)[ RSS](/packages/ahmedash95-sentimento/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Sentimento
==========

[](#sentimento)

A laravel package that provides sentiment analysis capabilities using OpenAI's GPT to easily analyze text-based data and gain insight into the underlying sentiment.

 [![Laravel Version](https://camo.githubusercontent.com/460683f883dde5a82adc43aae553a11b92b73204ef9668edece3778729cac991/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302d6f72616e6765)](https://camo.githubusercontent.com/460683f883dde5a82adc43aae553a11b92b73204ef9668edece3778729cac991/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302d6f72616e6765) [![GitHub Workflow Status (master)](https://camo.githubusercontent.com/40bbe5366c7445bc6f087b78bb53b88a952b18040dde2e02d64e2b2a416b7257/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f61686d656461736839352f73656e74696d656e746f2f54657374732f6d6173746572)](https://github.com/ahmedash95/sentimento/actions) [![Total Downloads](https://camo.githubusercontent.com/034ea040eb34e052f50f8411e5b695d5160ff85bce3a7ebef335d74e3ebc8140/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61686d656461736839352f73656e74696d656e746f)](https://packagist.org/packages/ahmedash95/sentimento) [![Latest Version](https://camo.githubusercontent.com/a0f08f140e9037aa77cded68c640afee10f7b013cfed6754fc4f9c8ae51bc4c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61686d656461736839352f73656e74696d656e746f)](https://packagist.org/packages/ahmedash95/sentimento) [![License](https://camo.githubusercontent.com/e92741ff913d01d6416896ccf7c3aebbb81fae676d172d799a71dacec82be9db/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61686d656461736839352f73656e74696d656e746f)](https://packagist.org/packages/ahmedash95/sentimento)

[![logo](logo.png)](logo.png)

```
use Ahmedash95\Sentimento\Facade\Sentimento;

$result = Sentimento::analyze("Food was great!");

$result->value; // Positive
```

Installation
------------

[](#installation)

- First you need to install the package using composer

```
composer require ahmedash95/sentimento
```

- (Optional) Publish config file

```
php artisan vendor:publish --tag="sentimento-config"
```

- Add your OpenAI API key to your .env file

```
SENTIMENTO_OPENAI_TOKEN=sk-xxxxxxxxxxxxxxxxxxxx
```

Now you are ready to use the package

Usage
-----

[](#usage)

OpenAI can comprehend multiple languages, and using it is as easy as invoking a function.

```
use Ahmedash95\Sentimento\Facade\Sentimento;

Sentimento::analyze("Food was great!"); // Positive

Sentimento::analyze("Food was bad!"); // Negative

Sentimento::analyze("لما اتصلت بالدليفري قالي انه اكل الاوردر"); // Negative
```

Warning

When calling OpenAI to analyze text, there is a possibility that HTTP exceptions may occur if the request to OpenAI fails. This can happen due to a variety of reasons, such as network connectivity issues, server errors, or even rate limiting policies imposed by OpenAI. If the request to OpenAI fails, the package may not be able to properly analyze the sentiment of the given text and may result in unexpected errors or output. To handle this, it is important to catch and handle any potential HTTP exceptions that may occur

```
use Ahmedash95\Sentimento\Facade\Sentimento;
use Illuminate\Http\Client\RequestException;

try {
    $result = Sentimento::analyze("Food was great!");
} catch (RequestException $e) {
    // $e->getMessage()
}
```

Or you can set the `report_failures` option to `false` in the config file to disable reporting failures

```
// instead of exception, the result will be Decision::Unknown

$result = Sentimento::analyze("Food was great!"); // Unknown
```

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

Credits
=======

[](#credits)

- [Ahmed Ammar](https://github.com/ahmedash95)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1212d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a8f7720b07ee7addde37df48b85d7de8e127f043d7c1b7aacd0af79328301f0d?d=identicon)[ahmedash95](/maintainers/ahmedash95)

---

Top Contributors

[![ahmedash95](https://avatars.githubusercontent.com/u/8272048?v=4)](https://github.com/ahmedash95 "ahmedash95 (10 commits)")

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ahmedash95-sentimento/health.svg)

```
[![Health](https://phpackages.com/badges/ahmedash95-sentimento/health.svg)](https://phpackages.com/packages/ahmedash95-sentimento)
```

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k91](/packages/nativephp-mobile)[firefly-iii/data-importer

Firefly III Data Import Tool.

8035.8k](/packages/firefly-iii-data-importer)[ronasit/laravel-helpers

Provided helpers function and some helper class.

2085.6k31](/packages/ronasit-laravel-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
