PHPackages                             amrlotfy/laravel-ai-smart-reply - 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. amrlotfy/laravel-ai-smart-reply

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

amrlotfy/laravel-ai-smart-reply
===============================

Smart, multilingual AI-powered reply generator for any CRM / ERP / Support system built with Laravel. Supports OpenAI and OpenRouter, with Arabic and English responses.

v1.0.3(6mo ago)932MITPHPPHP ^8.0

Since Oct 18Pushed 6mo agoCompare

[ Source](https://github.com/AmrLotfy/laravel-ai-smart-reply)[ Packagist](https://packagist.org/packages/amrlotfy/laravel-ai-smart-reply)[ RSS](/packages/amrlotfy-laravel-ai-smart-reply/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

🧠 Laravel AI Smart Reply
========================

[](#-laravel-ai-smart-reply)

**by [Amr Lotfy](https://www.linkedin.com/in/amr-lotfy-saleh-09438b113/)**

> Smart, multilingual AI-powered reply generator for any CRM / ERP / Support system built with Laravel.
> Supports **OpenAI** and **OpenRouter**, with Arabic and English responses.

---

⚙️ Features
-----------

[](#️-features)

- 🧩 **Provider-based architecture** (OpenAI, OpenRouter)
- 🌍 **Language support:** Arabic / English / Both
- 💬 **Customizable AI prompt templates**
- ⚡ **Plug &amp; play:** Works with any CRM, ERP, or Ticket System
- 🪶 **Lightweight &amp; extendable** — easy to add new providers

---

📦 Installation
--------------

[](#-installation)

You can install the package via Composer:

```
composer require amrlotfy/laravel-ai-smart-reply
```

If Laravel does not auto-discover the provider, you can manually register it in
`config/app.php`:

```
'providers' => [
    AmrLotfy\AiSmartReply\AiSmartReplyServiceProvider::class,
],
```

Then publish the configuration file:

```
php artisan vendor:publish --provider="AmrLotfy\AiSmartReply\AiSmartReplyServiceProvider" --tag=config
```

---

⚙️ Configuration
----------------

[](#️-configuration)

Set your environment variables in `.env`:

```
AI_SMART_REPLY_PROVIDER=openai
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4o-mini
OPENROUTER_API_KEY=sk-...
OPENROUTER_MODEL=gpt-4-turbo
AI_SMART_REPLY_LANG=both

```

---

🧠 Usage Example
---------------

[](#-usage-example)

```
use AmrLotfy\AiSmartReply\Services\AiReply;

// English
$reply = AiReply::generate(
    message: 'Customer: My payment failed',
    context: 'CRM Ticket #552',
    lang: 'en'
);

echo $reply;

// Arabic
$reply = AiReply::generate(
    message: 'العميل قال إن الدفع فشل',
    context: 'تذكرة رقم 552',
    lang: 'ar'
);

echo $reply;
```

---

🧩 Configuration File Overview
-----------------------------

[](#-configuration-file-overview)

`config/ai-smart-reply.php`:

```
return [
    'default' => 'openai', // or openrouter
    'language' => 'both',  // en | ar | both

    'providers' => [
        'openai' => [...],
        'openrouter' => [...],
    ],

    'templates' => [
        'default' => [
            'en' => "You are a helpful support assistant. Context: {context}. Message: {message}",
            'ar' => "أنت مساعد دعم فني. السياق: {context}. الرسالة: {message}",
        ],
    ],
];
```

---

🧱 Extend It
-----------

[](#-extend-it)

To add another provider, just create a class implementing:

```
AmrLotfy\AiSmartReply\Providers\AiProviderInterface
```

and register it in `config/ai-smart-reply.php`.

---

🧪 Coming Soon (v1.1)
--------------------

[](#-coming-soon-v11)

- 🧠 Reply caching
- 🔁 Retry &amp; Rate Limit handling
- 💬 Streaming responses
- 🧪 Unit Tests
- ⚙️ Queue support

---

🧑‍💻 Author
----------

[](#‍-author)

**Amr Lotfy**

- 💼 [LinkedIn](https://www.linkedin.com/in/amr-lotfy-saleh-09438b113/)
- 📧
- 🧰 Laravel Developer | AI Automation Expert | Instructor

---

📄 License
---------

[](#-license)

MIT License © 2025 Amr Lotfy

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance66

Regular maintenance activity

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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

4

Last Release

206d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.0.2PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![AmrLotfy](https://avatars.githubusercontent.com/u/19728125?v=4)](https://github.com/AmrLotfy "AmrLotfy (3 commits)")

---

Tags

aichatgptlaravellaravel-packageopenaiopenrouterphpsmart-replylaravelautomationaiopenaicrmsupportchatbotOpenRouterreply-generator

### Embed Badge

![Health badge](/badges/amrlotfy-laravel-ai-smart-reply/health.svg)

```
[![Health](https://phpackages.com/badges/amrlotfy-laravel-ai-smart-reply/health.svg)](https://phpackages.com/packages/amrlotfy-laravel-ai-smart-reply)
```

###  Alternatives

[binshops/laravel-ticket

A simple ticketing system for Laravel 5.1 – 5.8 and 6.\* - 7.\* - 8.\* - 9.\* - 10.\* -which integrates smoothly with Laravel default users and auth system

261.0k](/packages/binshops-laravel-ticket)[salehhashemi/laravel-intelli-git

An intelligent Git helper package for Laravel applications. It utilizes OpenAI's GPT to analyze your Git repository, providing features such as automatic generation of commit messages based on staged changes.

131.5k](/packages/salehhashemi-laravel-intelli-git)

PHPackages © 2026

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