Download the PHP package infobagubits/whatsapp-kapso without Composer

On this page you can find all versions of the php package infobagubits/whatsapp-kapso. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package whatsapp-kapso

Laravel Kapso

Il pacchetto semplifica l'integrazione con Kapso.ai permettendo di:

Installazione

composer require infobagubits/whatsapp-kapso

Configurazione

Dentro il file env ci devono essere queste keys:

Registrazione del Webhook

Dopo aver configurato il numero WhatsApp, possiamo registrare il webhook con: php artisan laravel-kapso:webhook-register

Il package registrerà automaticamente l'endpoint Laravel per ricevere gli eventi WhatsApp da Kapso.

Pubblicare il file di configurazione laravel-kapso

php artisan laravel-kapso:webhook-register

questo pubblicherà il file laravel-kapso.php

Esempio di come inviare un messaggio semplice

Dopo aver configurato tutto il necessario possiamo procedere importando la classe Kapso, che ci permette di accedere ai metodi messi a disposizione dal package.

Esempio:

$kapso = new Kapso(); // Classe del package

$to = '393445685734'; // Numero a cui inviare il messaggio

$message = 'Matteo mandami un messaggio'; // Messaggio da inviare

$kapso->sendText($to, $message);

Esempio di come gestire un webhook

Quando pubblichiamo il file di configurazione laravel-kapso, la voce handler sarà inizialmente vuota:

'webhook' => [ 'handler' => null, ],

Possiamo registrare una classe personalizzata per gestire i messaggi in arrivo con evento:

whatsapp.message.receivedreceived

Possiamo creare una classe handler nel nostro progetto esempio: class KapsoHandler { /** @param array<string, mixed> $payload / public function handle(?string $event, array $payload): void { Log::info('Kapso webhook ricevuto', [ 'event' => $event, 'id' => $payload['id'] ?? null, 'payload' => $payload, ]); } }

Infine inseriamo nel file di configurazione il path della classe: 'webhook' => [ 'handler' => \App\Webhooks\KapsoHandler::class, .... ],

Da questo momento, quando Kapso invierà un evento whatsapp.message.received inviera i dati ricevuti al metodo handle


All versions of whatsapp-kapso with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0
guzzlehttp/guzzle Version ^7.8 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package infobagubits/whatsapp-kapso contains the following files

Loading the files please wait ...