PHPackages                             wppconnect-team/wppconnect-laravel-client - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. wppconnect-team/wppconnect-laravel-client

ActiveLibr[HTTP &amp; Networking](/categories/http)

wppconnect-team/wppconnect-laravel-client
=========================================

A simple API with Guzzle wrapper, providing easy access to wppconnect's endpoints.

1.0.1(5y ago)403.7k↑31%10MITPHPPHP &gt;=7.4

Since Apr 19Pushed 3y ago6 watchersCompare

[ Source](https://github.com/wppconnect-team/wppconnect-laravel-client)[ Packagist](https://packagist.org/packages/wppconnect-team/wppconnect-laravel-client)[ Docs](https://github.com/wppconnect-team/wppconnect-laravel-client)[ RSS](/packages/wppconnect-team-wppconnect-laravel-client/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

WPPConnect Team
===============

[](#wppconnect-team)

*Wppconnect Laravel Client*
---------------------------

[](#wppconnect-laravel-client)

Uma API simples com empacotador Guzzle, fornecendo acesso fácil aos endpoints do WPPConnect Server.

Nossos canais online
--------------------

[](#nossos-canais-online)

[![Discord](https://camo.githubusercontent.com/d295d006321f79f12fa09e3719443b33d80925205a2354e9c265c70f82ffaecb/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3834343335313039323735383431333335333f636f6c6f723d626c756576696f6c6574266c6162656c3d446973636f7264266c6f676f3d646973636f7264267374796c653d666c6174)](https://discord.gg/JU5JGGKGNG)[![Telegram Group](https://camo.githubusercontent.com/110b312affbdcdbae8c57feae6d4fda7ed0c5b7bdc0ea31d38d64e646baf751c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54656c656772616d2d47726f75702d3332414645443f6c6f676f3d74656c656772616d)](https://t.me/wppconnect)[![WhatsApp Group](https://camo.githubusercontent.com/abab26c6ead1458abad829719c8ced89a2bc6284a74c53d307cea7c0f359dd9c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f57686174734170702d47726f75702d3235443336363f6c6f676f3d7768617473617070)](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K)[![YouTube](https://camo.githubusercontent.com/75360cffaab5dd13c92ba7450bcd5ce2fc07dcd1685fe79c5b192e1c1acd7b0a/68747470733a2f2f696d672e736869656c64732e696f2f796f75747562652f6368616e6e656c2f73756273637269626572732f554344374a394c473038506d4751724635495337597639413f6c6162656c3d596f7554756265)](https://www.youtube.com/c/wppconnect)

Requisitos
==========

[](#requisitos)

- PHP 7.4 ou superior.
- Laravel [8.x](https://laravel.com/docs/8.x) ou superior.

Intalação - Laravel
-------------------

[](#intalação---laravel)

Baixe o pacote com o Composer (Packagist), utilizando o seguinte comando:

```
$ composer require wppconnect-team/wppconnect-laravel-client
```

Registre o WppconnectServiceProvider nos providers dentro de `config/app.php`:

```
 WPPConnectTeam\Wppconnect\WppconnectServiceProvider::class
```

Publique os arquivos do vendo (arquivo de configuração):

```
$ php artisan vendor:publish
```

**Opcional**Registre o facade em `config/app.php`:

```
'Wppconnect' => WPPConnectTeam\Wppconnect\Facades\Wppconnect::class
```

Configuração
------------

[](#configuração)

Configuração aplicada a todas as solicitações criadas pela API.

Exemplo:

```
'defaults' => [
     /**
      * URL do WPPConnect Server
      */
     'base_uri' => 'http://192.168.0.39:21465',

     /**
      * Secret Key
      * Veja: https://github.com/wppconnect-team/wppconnect-server#secret-key
      */
     'secret_key' => 'MYKeYPHP'
 ]
```

Uso
---

[](#uso)

Utilize este pacote sem qualquer configuração com o Wppconnect facade em seu controlador, ou, injete-o na classe onde o cliente se faz necessário:

```
/**
 * @var RequestInterface
 */
protected $client;

/**
 * @param Wppconnect $client
 */
public function __construct(Wppconnect $client)
{
    $this->client = $client;
}
```

**Exemplo com o Facade:**

```
class WppconnectController extends Controller
{

    protected $url;
    protected $key;
    protected $session;

    /**
     * __construct function
     */
    public function __construct()
    {
        $this->url = config('wppconnect.defaults.base_uri');
        $this->key = config('wppconnect.defaults.secret_key');
	$this->session = "mySession";
    }

    public function index(){

	#Function: Generated Token
	# /api/:session/generate-token

        //Session::flush();
        if(!Session::get('token') and !Session::get('session')):
            Wppconnect::make($this->url);
            $response = Wppconnect::to('/api/'.$this->session.'/'.$this->key.'/generate-token')->asJson()->post();
            $response = json_decode($response->getBody()->getContents(),true);
            if($response['status'] == 'success'):
                Session::put('token', $response['token']);
                Session::put('session', $response['session']);
            endif;
        endif;

	#Function: Start Session
	# /api/:session/start-session

        if(Session::get('token') and Session::get('session') and !Session::get('init')):
            Wppconnect::make($this->url);
            $response = Wppconnect::to('/api/'.Session::get('session').'/start-session')->withHeaders([
                'Authorization' => 'Bearer '.Session::get('token')
            ])->asJson()->post();
            $response = json_decode($response->getBody()->getContents(),true);
            Session::put('init', true);
        endif;

    }
 }
```

```
   #Function: Check Connection Session
   # /api/:session/check-connection-session

   if(Session::get('token') and Session::get('session') and Session::get('init')):
       Wppconnect::make($this->url);
       $response = Wppconnect::to('/api/'. Session::get('session').'/check-connection-session')->withHeaders([
   	'Authorization' => 'Bearer '.Session::get('token')
       ])->asJson()->get();
       $response = json_decode($response->getBody()->getContents(),true);
       dd($response);
   endif;
```

```
   #Function: Close Session
   # /api/:session/close-session

   if(Session::get('token') and Session::get('session') and Session::get('init')):
       Wppconnect::make($this->url);
       $response = Wppconnect::to('/api/'. Session::get('session').'/close-session')->withHeaders([
   	'Authorization' => 'Bearer '.Session::get('token')
       ])->asJson()->post();
       $response = json_decode($response->getBody()->getContents(),true);
       dd($response);
   endif;
```

```
   #Function: Send Message
   # /api/:session/send-message

   if(Session::get('token') and Session::get('session') and Session::get('init')):
       Wppconnect::make($this->url);
       $response = Wppconnect::to('/api/'. Session::get('session').'/send-message')->withBody([
   	'phone' => '5500000000000',
   	'message' => 'Opa, funciona mesmo!'
       ])->withHeaders([
   	'Authorization' => 'Bearer '.Session::get('token')
       ])->asJson()->post();
       $response = json_decode($response->getBody()->getContents(),true);
       dd($response);
   endif;
```

```
   #Function: Send File Base64
   # /api/:session/send-file-base64

   if(Session::get('token') and Session::get('session') and Session::get('init')):
       Wppconnect::make($this->url);
       $response = Wppconnect::to('/api/'. Session::get('session').'/send-file-base64')->withBody([
   	'phone' => '5500000000000',
   	'base64' => 'data:image/jpg;base64,' . base64_encode(file_get_contents(resource_path('/img/xpto.jpg')))
       ])->withHeaders([
   	'Authorization' => 'Bearer '.Session::get('token')
       ])->asJson()->post();
       $response = json_decode($response->getBody()->getContents(),true);
       dd($response);
   endif;
```

Debug
=====

[](#debug)

Usar `debug(bool|resource)` antes de enviar uma solicitação para ativar o depurador do Guzzle. Para mais informações acesse a [documentação](http://docs.guzzlephp.org/en/stable/request-options.html#debug).

O debug é desligado após cada solicitação, se você precisar depurar várias solicitações enviadas sequencialmente, será necessário ativar a depuração para todas elas.

**Exemplo**

```
$logFile = './client_debug_test.log';
$logFileResource = fopen($logFile, 'w+');

$this->client->debug($logFileResource)->to('post')->withBody([
	'foo' => 'bar'
])->asJson()->post();

fclose($logFileResource);
```

Os logs serão salvos no arquivo `client_debug_test.log`.

Postman
-------

[](#postman)

Acesse o [Postman Collection do WPPConnect](https://documenter.getpostman.com/view/9139457/TzshF4jQ) com todos os endpoints.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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

2

Last Release

1902d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33b8a278749efde08227d7dcb6c95a209222c50b57f8df3b561fb8a842ff2b46?d=identicon)[bgastaldi](/maintainers/bgastaldi)

---

Top Contributors

[![bgastaldi](https://avatars.githubusercontent.com/u/3454381?v=4)](https://github.com/bgastaldi "bgastaldi (24 commits)")[![edgardmessias](https://avatars.githubusercontent.com/u/1530997?v=4)](https://github.com/edgardmessias "edgardmessias (3 commits)")

---

Tags

facadelaravelwhatsappwhatsapp-apiwhatsapp-botwhatsapp-chatwppconnectlaravelGuzzlerest-clientwppconnect

### Embed Badge

![Health badge](/badges/wppconnect-team-wppconnect-laravel-client/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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