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(8mo ago)932MITPHPPHP ^8.0

Since Oct 18Pushed 8mo 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 today

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

32

—

LowBetter than 69% of packages

Maintenance59

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

258d ago

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

v1.0.2PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19728125?v=4)[Amr Lotfy](/maintainers/AmrLotfy)[@AmrLotfy](https://github.com/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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)

PHPackages © 2026

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