1. Go to this page and download the library: Download kirimi/laravel-kirimi 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/ */
kirimi / laravel-kirimi example snippets
use Kirimi\Laravel\Facades\Kirimi;
// Send a regular message
Kirimi::sendMessage('device_001', '628123456789', 'Hello from Kirimi!');
// Send a message with media
Kirimi::sendMessage('device_001', '628123456789', 'Check this out!', 'https://example.com/image.jpg');
// Send fast (no typing effect)
Kirimi::sendMessageFast('device_001', '628123456789', 'Quick message');
// Broadcast to many recipients (numbers is an array, label is 'Hi there!']);
// Generate OTP
Kirimi::generateOTP('device_001', '628123456789', ['otp_length' => 6]);
// Send OTP v2 (whatsapp | device | waba_user)
Kirimi::sendOtpV2('628123456789', ['method' => 'whatsapp']);
Kirimi::sendOtpV2('628123456789', ['method' => 'device', 'device_id' => 'device_001', 'custom_message' => 'Your code is {{otp}}']);
Kirimi::sendOtpV2('628123456789', ['method' => 'waba_user', 'waba_id' => 'waba_001', 'template_name' => 'otp_login']);
// Save a contact (nama + nomor)
Kirimi::saveContact('Budi', '628123456789');
// Devices
$devices = Kirimi::listDevices();
$status = Kirimi::deviceStatus('device_001');
$newDevice = Kirimi::createDevice(1);
// Packages & deposits
$packages = Kirimi::listPackages();
$deposit = Kirimi::createDeposit(50000);
$status = Kirimi::depositStatus($deposit['ref']);
use Illuminate\Notifications\Notification;
use Kirimi\Laravel\Messages\KirimiMessage;
class OrderPaid extends Notification
{
public function __construct(private string $orderNumber) {}
public function via($notifiable): array
{
return ['kirimi'];
}
public function toKirimi($notifiable): KirimiMessage
{
return (new KirimiMessage)
->to($notifiable->phone)
->device($notifiable->kirimi_device_id) // optional, falls back to config default
->message("Order #{$this->orderNumber} has been paid. Thank you!");
}
}
public function toKirimi($notifiable): KirimiMessage
{
return KirimiMessage::create('Your invoice is ready.')
->to($notifiable->phone)
->mediaUrl('https://example.com/invoice.pdf');
}