> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# LINE SDK for Laravel

> Un package qui rend le SDK officiel de LINE plus facile à utiliser avec Laravel. Fournit quatre fonctionnalités : Webhook, Bot, notifications et Socialite.

## Vue d'ensemble

[revolution/laravel-line-sdk](https://github.com/invokable/laravel-line-sdk) est un package qui simplifie l'utilisation du SDK officiel de LINE depuis Laravel.

Il fournit quatre fonctionnalités : réception de Webhook, Facade Bot, intégration avec Laravel Notifications et LINE Login (Socialite).

> [!NOTE]
>
> Ce package nécessite PHP 8.3 ou supérieur et Laravel 12.0 ou supérieur.

## Installation

```shell theme={null}
composer require revolution/laravel-line-sdk
```

## Configuration

### Console LINE Developers

Créez un canal dans [LINE Developers](https://developers.line.biz/).

> [!NOTE]
>
> Les canaux Messaging API ne peuvent plus être créés directement depuis la console LINE Developers. Créez d'abord un compte officiel dans [LINE Official Account Manager](https://manager.line.biz/), puis activez l'utilisation de l'API Messaging.

Créez deux canaux.

| Canal | À récupérer |
| - | - |
| **Messaging API** | Channel access token (long-lived), Channel secret |
| **LINE Login** | Channel ID, Channel secret |

### .env

```dotenv theme={null}
LINE_BOT_CHANNEL_TOKEN=
LINE_BOT_CHANNEL_SECRET=

LINE_LOGIN_CLIENT_ID=
LINE_LOGIN_CLIENT_SECRET=
LINE_LOGIN_REDIRECT=
```

### Publier le fichier de configuration (facultatif)

```shell theme={null}
php artisan vendor:publish --tag=line-config
```

## Démarrage rapide

Voici la procédure la plus courte pour faire fonctionner un bot.

**1. Créer un nouveau projet Laravel**

```shell theme={null}
laravel new line-bot
cd ./line-bot
composer require revolution/laravel-line-sdk
```

**2. Configurer le .env**

```dotenv theme={null}
LINE_BOT_CHANNEL_TOKEN=
LINE_BOT_CHANNEL_SECRET=
```

**3. Publier le listener par défaut**

```shell theme={null}
php artisan vendor:publish --tag=line-listeners
```

Un `MessageListener` est généré dans `app/Listeners/Line/`.

**4. Déployer sur un serveur web**

Pour recevoir des Webhooks depuis LINE, une URL publique est nécessaire. La réception n'est pas possible depuis un serveur local.

Définissez l'URL du Webhook dans la console LINE Developers.

```
https://example.com/line/webhook
```

**5. Ajouter le bot comme ami et tester**

Ajoutez le bot comme ami en utilisant le QR code du canal Messaging API. Lorsque vous envoyez un message, `MessageListener` le renvoie tel quel en écho.

## Documentation

> [card] [Webhook / Bot](https://kawax.biz/fr/packages/laravel-line-sdk/bot.md)
>
> Envoi et réception de messages avec le contrôleur Webhook et la Facade Bot.

> [card] [Canal de notification](https://kawax.biz/fr/packages/laravel-line-sdk/notification.md)
>
> Intégration de l'API Messaging de LINE avec le système de notifications de Laravel.

> [card] [Socialite (LINE Login)](https://kawax.biz/fr/packages/laravel-line-sdk/socialite.md)
>
> Implémenter l'authentification OAuth2 via LINE Login avec Socialite.

## Liens de référence

* GitHub : [invokable/laravel-line-sdk](https://github.com/invokable/laravel-line-sdk)
* Démo : [invokable/laravel-line-project](https://github.com/invokable/laravel-line-project)
* DeepWiki : [invokable/laravel-line-sdk](https://deepwiki.com/invokable/laravel-line-sdk)


## Related topics

- [Socialite (LINE Login) - LINE SDK for Laravel](https://kawax.biz/fr/packages/laravel-line-sdk/socialite.md)
- [Webhook / Bot - LINE SDK for Laravel](https://kawax.biz/fr/packages/laravel-line-sdk/bot.md)
- [Canal de notification - LINE SDK for Laravel](https://kawax.biz/fr/packages/laravel-line-sdk/notification.md)
- [Laravel AI SDK](https://kawax.biz/fr/ai-sdk.md)
- [Intégration Laravel AI SDK - VOICEVOX for Laravel](https://kawax.biz/fr/packages/laravel-voicevox/ai-sdk.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.