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 1mo ago

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

27

—

LowBetter than 49% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity36

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

1155d 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

[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[backpack/basset

Dead-simple way to load CSS or JS assets only once per page, when using Laravel 10+.

202832.4k6](/packages/backpack-basset)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

97139.6k2](/packages/nickurt-laravel-akismet)[burtds/laravel-vatnumber-checker

A simple VAT Number checker package for Laravel.

65121.5k](/packages/burtds-laravel-vatnumber-checker)

PHPackages © 2026

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