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

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

gabrielmoura/laravel-utalk
==========================

Facade for Umbler Utalk

00PHP

Since Dec 4Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

[![Laravel Utalk](doc/laravel-utalk.webp)](doc/laravel-utalk.webp)

[![Latest Stable Version](https://camo.githubusercontent.com/83be37f36cd4b11ece846d339e183d70683eaf1a1ee156add622174a61218333/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6761627269656c6d6f7572612f6c61726176656c2d7574616c6b)](https://packagist.org/packages/gabrielmoura/laravel-utalk)[![License](https://camo.githubusercontent.com/e4c6cd65edf61c846d53aec2fee524f6f86c8ad9e21d7fa4aebbc61edb82ee9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6761627269656c6d6f7572612f6c61726176656c2d7574616c6b)](https://packagist.org/packages/gabrielmoura/laravel-utalk)

- [Objective](#objective)
- [Usage](#usage)
    - [Facade](#facade)
    - [Container](#container)
    - [Helper](#helper)
- [WebHook](#webhook)
- [Configurations](#configurations)
- [Documentation](doc/DOC.md)

Objective
---------

[](#objective)

In this version, the purpose is to establish integration with the Utalk messaging service for sending and receiving messages. However, the currently implemented functionalities only reflect the rudimentary use of the API, and there is no automation process.

Usage
-----

[](#usage)

### Facade

[](#facade)

```
use Gabrielmoura\LaravelUtalk\Utalk;
Utalk::member()->getMe();
```

### Container

[](#container)

```
app('Utalk')->member()->getMe();
```

### Helper

[](#helper)

```
utalk()->member()->getMe();
```

WebHook
-------

[](#webhook)

### IPs

[](#ips)

You can obtain the list of IPs that will be used for message delivery.

```
utalk()->webhook()->getIps();
```

### Optional Configuration

[](#optional-configuration)

And define them in config/services.php

```
'allow_ips' =>
            [
                '40.88.132.66/32',
                '52.188.209.245/32',
                '52.188.209.200/32',
                '40.88.5.13/32',
                '13.82.149.8/32',
                '20.121.215.166/32',
                '52.191.24.158/32',
            ]
```

By default, the package checks if the IP falls within the list of allowed IPs:

- 127.0.0.1/8
- 192.168.0.1/16
- 10.0.0.1/24
- 172.16.0.0/12
- 40.88.132.66/32
- 52.188.209.245/32
- 52.188.209.200/32
- 40.88.5.13/32
- 13.82.149.8/32
- 20.121.215.166/32
- 52.191.24.158/32

### WebHook Route

[](#webhook-route)

Certain webhooks resend the message if they do not receive an HTTP response code in the 20x range. Therefore, it is essential that the route responsible for receiving the webhook issues a success code before proceeding to handle the received message.

This package provides a route for receiving webhooks and middleware for checking the origin IP. To use it, simply add the route to the routes file corresponding to ***/webhook/utalk***.

```
// routes/web.php
    Route::utalk()
```

It is encouraged to create a Listener for the event of receiving messages through the webhook.

```
