PHPackages                             pharit/laravel-line-api - 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. [API Development](/categories/api)
4. /
5. pharit/laravel-line-api

ActiveLibrary[API Development](/categories/api)

pharit/laravel-line-api
=======================

A Laravel package for LINE Messaging API (push, reply, multicast, signature verification).

00PHP

Since Aug 11Pushed 9mo agoCompare

[ Source](https://github.com/pharit/laravel-line-api)[ Packagist](https://packagist.org/packages/pharit/laravel-line-api)[ RSS](/packages/pharit-laravel-line-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel LINE API
----------------

[](#laravel-line-api)

A lightweight Laravel package for LINE Messaging API: push, reply, multicast, broadcast, profile lookup, and webhook signature verification.

### Install (local path)

[](#install-local-path)

1. Add to your app's `composer.json` repositories:

```
"repositories": [
  {
    "type": "path",
    "url": "../laravel-line-api",
    "options": { "symlink": true }
  }
]
```

2. Require the package in your app:

```
composer require iaa/laravel-line-api:dev-main
```

3. Publish config:

```
php artisan vendor:publish --tag=config --provider="Pharit\\LaravelLineApi\\LaravelLineApiServiceProvider"
```

4. Set env vars:

```
LINE_CHANNEL_ACCESS_TOKEN=your_channel_access_token
LINE_CHANNEL_SECRET=your_channel_secret
```

### Usage

[](#usage)

```
use Pharit\\LaravelLineApi\\Facades\\Line;

// Reply
Line::reply($replyToken, [
    Line::textMessage('Hello!'),
]);

// Push
Line::push($userId, [
    ['type' => 'text', 'text' => 'Update available'],
]);

// Multicast
Line::multicast([$userId1, $userId2], [
    ['type' => 'text', 'text' => 'Hello all'],
]);

// Broadcast
Line::broadcast([
    ['type' => 'text', 'text' => 'System maintenance 10pm'],
]);

// Profile
$profile = Line::getProfile($userId)->json();
```

### Rich menu

[](#rich-menu)

```
use Pharit\\LaravelLineApi\\Facades\\Line;

// Create
$response = Line::createRichMenu([
    'size' => ['width' => 2500, 'height' => 843],
    'selected' => false,
    'name' => 'My Menu',
    'chatBarText' => 'Tap here',
    'areas' => [
        [
            'bounds' => ['x' => 0, 'y' => 0, 'width' => 1250, 'height' => 843],
            'action' => ['type' => 'message', 'text' => 'Hello'],
        ],
        [
            'bounds' => ['x' => 1250, 'y' => 0, 'width' => 1250, 'height' => 843],
            'action' => ['type' => 'uri', 'uri' => 'https://example.com'],
        ],
    ],
]);
$richMenuId = $response->json('richMenuId');

// Upload image (path). Content-Type auto-detected from extension
Line::uploadRichMenuImage($richMenuId, storage_path('app/menu.png'));

// Link to a user
Line::linkRichMenuToUser($userId, $richMenuId);

// Set as default for all users
Line::setDefaultRichMenu($richMenuId);

// List
$list = Line::getRichMenuList()->json('richmenus');
```

### Verify webhook signatures

[](#verify-webhook-signatures)

Add middleware to your webhook route to validate `X-Line-Signature`:

```
use Pharit\\LaravelLineApi\\Http\\Middleware\\VerifyLineSignature;

Route::post('/line/webhook', Controller::class)
    ->middleware(VerifyLineSignature::class);
```

Disable via `LINE_VERIFY_SIGNATURE=false` if needed.

### Configuration

[](#configuration)

See `config/line.php` after publish.

### License

[](#license)

MIT

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance43

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e77c782ff0f62adfdba67ff4a5893ffc5c7afb9cf30154ac87679cc3b19cb9e?d=identicon)[nkaajtooj](/maintainers/nkaajtooj)

---

Top Contributors

[![pharit](https://avatars.githubusercontent.com/u/22044407?v=4)](https://github.com/pharit "pharit (2 commits)")

### Embed Badge

![Health badge](/badges/pharit-laravel-line-api/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

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