1. Go to this page and download the library: Download ges/laravel-green-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Ges\LaravelGreenApi\Notifications\GreenApiChannel;
use Ges\LaravelGreenApi\Notifications\GreenApiMessage;
use Illuminate\Notifications\Notification;
class InvoicePaid extends Notification
{
public function via(object $notifiable): array
{
return [GreenApiChannel::class];
}
public function toGreenApi(object $notifiable): GreenApiMessage
{
return GreenApiMessage::make('Invoice paid.');
}
}
public function via(object $notifiable): array
{
return ['green_api'];
}
public function toGreenApi(object $notifiable): GreenApiMessage
{
return GreenApiMessage::make()
->file(storage_path('app/invoice.pdf'), 'Invoice attached', 'invoice.pdf');
}