PHP code example of irnoti / laravel-sms-panel-api
1. Go to this page and download the library: Download irnoti/laravel-sms-panel-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/ */
irnoti / laravel-sms-panel-api example snippets
Irnoti::sms()->send(lineId: 1, to: '09121234567', text: 'Your order has shipped!');
// One or many recipients and/or phonebook groups (max 10,000 numbers; Persian digits and +98 are fine).
Irnoti::sms()->send(lineId: 1, text: 'Flash sale!', to: ['09121234567', '09351234567'], groupIds: [12]);
// Cost without sending or charging.
Irnoti::sms()->quote(lineId: 1, text: 'Flash sale!', to: '09121234567'); // count, parts, totalPrice
// Later: 1 minute – 60 days ahead. The cost is reserved immediately.
Irnoti::sms()->send(lineId: 1, text: 'Reminder', to: '09121234567', scheduledAt: now()->addDay());
// Gradual: release 500 messages every 10 minutes (combinable with scheduledAt).
Irnoti::sms()->send(lineId: 1, text: 'Hi', groupIds: [12], gradual: ['chunkSize' => 500, 'intervalMinutes' => 10]);
// Approved template (pattern) — OTP / transactional.
Irnoti::sms()->pattern(code: 'k3f9a2', to: '09121234567', params: ['code' => '4821']);
// Critical alerts over the platform's own routes with automatic provider failover (≤ 200 recipients).
Irnoti::sms()->sos(to: ['09121234567'], text: 'Service down');
Irnoti::messages()->list(take: 50); // newest first; page with before: <last id>
Irnoti::messages()->get(5521); // status: queued | sent | delivered | failed
Irnoti::messages()->check(5521); // ask the operator now (30/min)
Irnoti::batches()->scheduled();
Irnoti::batches()->cancel(918); // refunds what has not been released
Irnoti::batches()->pause(918);
Irnoti::batches()->resume(918);
Irnoti::lines()->list(); // ids to use as lineId