PHPackages                             beon/laravel - 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. beon/laravel

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

beon/laravel
============

Send WhatsApp messages from Laravel in 3 lines — powered by Beon API

v1.3.0(1mo ago)13MITPHPPHP ^8.1

Since Apr 15Pushed 1mo agoCompare

[ Source](https://github.com/yasserfarag22/beon-laravel)[ Packagist](https://packagist.org/packages/beon/laravel)[ RSS](/packages/beon-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

beon-laravel 🚀
==============

[](#beon-laravel-)

**The Professional WhatsApp SDK for Laravel.**

`beon-laravel` offers a streamlined, object-oriented approach to integrating WhatsApp messaging into Laravel applications. Designed for reliability and ease of use, it features a fluent API, comprehensive error handling, and native integration with BeOn's messaging and CRM ecosystem.

---

✨ Key Features
--------------

[](#-key-features)

- **Fluent Messaging Interface:** Build complex messages using an intuitive, chainable syntax.
- **Automated CRM Sync:** Seamlessly update contact attributes and tags during the messaging lifecycle.
- **Smart Template Engine:** Resolve and send WhatsApp Business templates via configuration or dynamic IDs.
- **Multi-Media Support:** Native handling for images, videos, documents, and interactive buttons.
- **Robust Exception Handling:** Descriptive, catchable exceptions for API, validation, and connection errors.
- **Webhook Integration:** Built-in route macros and Laravel events for incoming messages and status updates.

---

🚀 Installation
--------------

[](#-installation)

1. Install the package via Composer:

```
composer require beon/laravel
```

2. Publish the configuration file:

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

3. Configure your credentials in `.env`:

```
BEON_API_KEY=your_beon_token_here
BEON_BASE_URL=https://v3.api.beon.chat
```

---

📖 Usage Guide
-------------

[](#-usage-guide)

### 1. Sending Templates (Fluent API)

[](#1-sending-templates-fluent-api)

The most efficient way to communicate using approved WhatsApp Business templates:

```
use Beon\Laravel\Facades\Beon;

Beon::to('201000830792', 'Yasser Farag')
    ->template('welcome_msg', 5103)
    ->withVariables(['Yasser', 'January 30th'])
    ->withAttributes(['customer_tier' => 'gold']) // Updates CRM attributes automatically
    ->send();
```

### 2. Session &amp; Direct Messaging

[](#2-session--direct-messaging)

Send rich media messages during an active 24-hour customer session:

```
// Simple Text
Beon::to($to)->text('How can we assist you today?')->send();

// Image with Caption
Beon::to($to)->image('https://example.com/promo.jpg', 'Exclusive Offer')->send();

// Document Attachment
Beon::to($to)->document('https://example.com/invoice.pdf', 'invoice_123.pdf')->send();
```

### 3. OTP &amp; Authentication

[](#3-otp--authentication)

Reliable delivery for one-time passwords via WhatsApp API:

```
// Direct OTP Delivery
Beon::sendOtp('201000830792', 'Yasser');

// OTP via Authenticated Template (with Auto-copy button)
Beon::sendOtpTemplate('201000830792', '123456');
```

---

❌ Error Management
------------------

[](#-error-management)

The package eliminates manual response checking by throwing specific exceptions:

```
try {
    Beon::to($to)->template('non_existent')->send();
} catch (\Beon\Laravel\Exceptions\ApiException $e) {
    // API-level errors (e.g., Auth, Insufficient Balance)
} catch (\Beon\Laravel\Exceptions\ValidationException $e) {
    // Local input validation errors
} catch (\Beon\Laravel\Exceptions\BeonException $e) {
    // General package-level issues
}
```

---

🔗 Webhook &amp; Events
----------------------

[](#-webhook--events)

Handle incoming customer interactions using Laravel's native Event system.

1. Register the webhook route in `routes/api.php`:

```
Route::beonWebhook();
```

2. Attach listeners in your `EventServiceProvider`:

```
protected $listen = [
    \Beon\Laravel\Events\MessageStatusUpdated::class => [
        \App\Listeners\UpdateMessageStatus::class,
    ],
    \Beon\Laravel\Events\MessageReceived::class => [
        \App\Listeners\HandleCustomerReply::class,
    ],
];
```

---

🧪 Testing
---------

[](#-testing)

The package includes a comprehensive test suite to ensure stability:

```
vendor/bin/phpunit
```

---

👨‍💻 Contribution &amp; Support
------------------------------

[](#‍-contribution--support)

Maintained by **Yasser Farag Abdelhamid** (Backend Developer at BeOn). For technical support or inquiries: [01000830792](https://www.google.com/search?q=tel:%2B201000830792)

📄 License
---------

[](#-license)

The MIT License (MIT). Please see the [License File](https://www.google.com/search?q=LICENSE) for more details.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance89

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

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

3

Last Release

54d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/93351795?v=4)[Yasser Farag](/maintainers/yasserfarag22)[@yasserfarag22](https://github.com/yasserfarag22)

---

Top Contributors

[![yasserfarag22](https://avatars.githubusercontent.com/u/93351795?v=4)](https://github.com/yasserfarag22 "yasserfarag22 (7 commits)")

---

Tags

laravelpackageotpmessagingwhatsappbeon

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/beon-laravel/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76318.2M110](/packages/laravel-mcp)[spatie/laravel-export

Create a static site bundle from a Laravel app

670139.5k6](/packages/spatie-laravel-export)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

268880.7k3](/packages/laravel-cashier-paddle)[api-platform/laravel

API Platform support for Laravel

59156.3k10](/packages/api-platform-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)

PHPackages © 2026

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