{"id":26978519,"url":"https://github.com/sysborg/kingsms-laravel","last_synced_at":"2026-03-11T09:03:10.769Z","repository":{"id":284619989,"uuid":"955501754","full_name":"sysborg/kingsms-laravel","owner":"sysborg","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-19T21:37:46.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T11:54:57.504Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysborg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-26T18:31:30.000Z","updated_at":"2025-07-19T21:37:20.000Z","dependencies_parsed_at":"2025-07-19T23:11:35.455Z","dependency_job_id":"bebcbf47-3dda-453d-bc9f-e2a74717b51b","html_url":"https://github.com/sysborg/kingsms-laravel","commit_stats":null,"previous_names":["sysborg/kingsms-laravel"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/sysborg/kingsms-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysborg%2Fkingsms-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysborg%2Fkingsms-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysborg%2Fkingsms-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysborg%2Fkingsms-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysborg","download_url":"https://codeload.github.com/sysborg/kingsms-laravel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysborg%2Fkingsms-laravel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30376782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-03T13:35:59.046Z","updated_at":"2026-03-11T09:03:10.762Z","avatar_url":"https://github.com/sysborg.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KingSMS Laravel Package\n\nEasily integrate [KingSMS](https://www.kingsms.com.br/) into your Laravel application.\n\nThis package simplifies the process of sending SMS, retrieving reports, checking balance, and receiving replies using the KingSMS API.\n\n---\n\n## 📦 Installation\n\nInstall the package via Composer:\n\n```bash\ncomposer require sysborg/kingsms\n```\n\nThe service provider is auto-discovered by Laravel, so no need to manually add it to `config/app.php`.\n\n---\n\n## ⚙️ Configuration\n\nAdd your KingSMS credentials to your `.env` file:\n\n```env\nKINGSMS_URL=https://painel.kingsms.com.br/kingsms/api.php\nKINGSMS_LOGIN=your_login\nKINGSMS_TOKEN=your_token\n```\n\nThe default API URL is already set, but you can override it if needed.\n\n---\n\n## 🚀 Usage\n\n### Send SMS\n\n```php\nuse Facades\\Sysborg\\KingSMS\\Services\\KingSMS;\n\n$response = KingSMS::sendSMS(\n    '5598999999999', // Recipient phone number\n    'Your message goes here', // Message content\n    'Optional Campaign Name',\n    'Optional Date (dd/mm/yyyy)',\n    'Optional Time (hh:mm)'\n);\n```\n\n### Get SMS Report\n\n```php\n$response = KingSMS::getRelatorio('your_sms_id');\n```\n\n### Check Balance\n\n```php\n$response = KingSMS::getSaldo();\n```\n\n### Get SMS Replies\n\n```php\n$response = KingSMS::getResposta('read'); // or 'unread'\n```\n\n---\n\n## 🔔 Using as Notification Channel\n\nYou can also send SMS using Laravel's notification system.\n\n### 1. Add `toKingsms()` method in your Notification:\n\n```php\npublic function via($notifiable)\n{\n    return ['kingsms'];\n}\n\npublic function toKingsms($notifiable)\n{\n    return 'This is your notification message';\n}\n```\n\n### 2. Your Notifiable Model must return the phone number\n\nTo let Laravel know which phone number to use, your notifiable model (usually User) must implement the following method:\n\n```php\npublic function routeNotificationForKingsms(): ?string\n{\n    // Example: clean Brazilian cellphone format and prepend +55\n    $phone = preg_replace('/\\D/', '', $this-\u003ecelular); // or $this-\u003ephone\n    return $phone ? '+55' . $phone : null;\n}\n```\n\nEnsure your notifiable entity has a `phone` attribute or method.\n\n---\n\n## 🔗 Useful Links\n\n- 📘 [Official KingSMS API Documentation](https://kingsms.docs.apiary.io/#)\n- 🌐 [KingSMS Website](https://www.kingsms.com.br/)\n\n---\n\n## 👨‍💻 Author\n\nDeveloped and maintained by:\n\n**Anderson Arruda**  \n📧 [andmarruda@gmail.com](mailto:andmarruda@gmail.com)\n\nAlso maintained by:  \n**Sysborg**  \n📧 [contato@sysborg.com.br](mailto:contato@sysborg.com.br)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysborg%2Fkingsms-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysborg%2Fkingsms-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysborg%2Fkingsms-laravel/lists"}