{"id":16085699,"url":"https://github.com/infinitypaul/laravel-notification-channel-termii","last_synced_at":"2025-03-18T06:30:33.901Z","repository":{"id":176161566,"uuid":"655006753","full_name":"infinitypaul/laravel-notification-channel-termii","owner":"infinitypaul","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-25T08:47:37.000Z","size":17,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T07:37:25.968Z","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/infinitypaul.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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}},"created_at":"2023-06-17T15:37:45.000Z","updated_at":"2024-04-29T07:46:55.000Z","dependencies_parsed_at":"2024-04-25T09:55:19.859Z","dependency_job_id":null,"html_url":"https://github.com/infinitypaul/laravel-notification-channel-termii","commit_stats":null,"previous_names":["infinitypaul/laravel-notification-channel-termii"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitypaul%2Flaravel-notification-channel-termii","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitypaul%2Flaravel-notification-channel-termii/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitypaul%2Flaravel-notification-channel-termii/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infinitypaul%2Flaravel-notification-channel-termii/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infinitypaul","download_url":"https://codeload.github.com/infinitypaul/laravel-notification-channel-termii/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243906083,"owners_count":20366967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-09T13:09:02.294Z","updated_at":"2025-03-18T06:30:33.601Z","avatar_url":"https://github.com/infinitypaul.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Termii notifications channel for Laravel\n\nThis package brings you the joy of sending [Termii notifications](https://developer.termii.com) with Laravel, with the same effortlessness as a Sunday morning coffee. Take a sip and let's get started.\n\n## Contents\n\n- [Installation](#installation)\n    - [Setting up your Termii account](#setting-up-your-termii-account)\n- [Usage](#usage)\n    - [Available Message methods](#available-message-methods)\n- [Changelog](#changelog)\n- [Testing](#testing)\n- [Security](#security)\n- [Contributing](#contributing)\n- [Credits](#credits)\n- [License](#license)\n\n## Installation\n\nYou can install the package faster than you can say \"composer\" via composer:\n\n``` bash\ncomposer require infinitypaul/laravel-notification-channel-termii\n```\n\nService providers... You gotta love them. You either have to install them yourself, or if you're living on the edge with\nLaravel 5.5 or higher, let the package auto discovery do the work for you:\n\n```php\n// config/app.php\n'providers' =\u003e [\n    ...\n    Infinitypaul\\Termii\\TermiiServiceProvider::class,\n],\n\n```\n\n### Setting up your Termii account\n\nTime to tell Laravel your deepest secret (aka your Termii API Key). Also, add your favorite channel and an optional\nSender ID. Whisper these to your config/services.php:\n\n```php\n// config/services.php\n'termii' =\u003e [\n'api_key' =\u003e env('TERMII_API_KEY'),\n'from' =\u003e env('TERMII_FROM'),\n'channel' =\u003e 'dnd' //because I know you love 'do not disturb' mode 😉\n]\n```\n\n## Usage\n\nThe next step is as easy as pie. Simply use the channel in your via() method inside the notification:\n\n```php\nuse Infinitypaul\\Termii\\TermiiChannel;\nuse Infinitypaul\\Termii\\TermiiMessage;\nuse Illuminate\\Notifications\\Notification;\n\nclass WelcomeSMS extends Notification\n{\n    public function via($notifiable)\n    {\n        return [TermiiChannel::class]; // see? pie!\n    }\n\n    public function toTermii($notifiable)\n    {\n        return (new TermiiMessage())\n            -\u003econtent(\"Thanks For Subscribing to infinitypaul.medium.com. We promise to only send interesting stuff, no cat videos... well, maybe just one.\");\n    }\n}\n```\n\nLet's tell your Notification where it's heading(which phone are you sending to). Add the routeNotificationForTermii\nmethod to your Notifiable model (e.g., your User Model).\n\n```php\npublic function routeNotificationForTermii()\n{\n    return $this-\u003ephone; // where `phone` is a field in your users table;\n}\n```\n\nor you can also just send it from `TermiiMessage` class in your `toTermii()` implementation.\n\n```php\npublic function toTermii($notifiable)\n    {\n        return (new TermiiMessage())\n            -\u003econtent(\"Thanks For Subscribing to infinitypaul.medium.com. We promise to only send interesting stuff, no cat videos... well, maybe just one.\")\n            -\u003eto(\"234100000001\");\n    }\n```\n\n### Available Message methods\n\n#### TermiiMessage\n\n- `from('')`: Accepts a string -Represents a sender ID for sms which can be Alphanumeric or Device name for Whatsapp.\n  Alphanumeric sender ID length should be between 3 and 11 characters (Example:CompanyName).\n- `to('')`: Accepts a string - Represents a destination ID for sms in international format (Example: 2338013828492).\n  It is optional, and can be set in the notifable model `routeNotificationForTermii()`.\n- `content('')`: Accepts a string - Text of a message that would be sent to the destination phone number.\n- `channel('')`: Accepts a string This is the route through which the message is sent. It is either `dnd`, `whatsapp`,\n  or `generic`, by default it is dnd.\n- `media('')`: Accepts an array, if your channel is `whatsapp` This is a media object, it is only available for the High\n  Volume WhatsApp. When using the media parameter, ensure you are not using the sms parameter.\n- `media_url('')`: Accepts a string, if your channel is `whatsapp` The url to the file resource,.\n- `media_option('')`: Accepts a string, if your channel is `whatsapp` The caption that should be added to the image,.\n\n## Changelog\n\nCurious about our termii journey? Check out CHANGELOG for more information on what has changed recently.\n\n## Testing\n\n```php\ncomposer test //(We promise it won't explode.)\n```\n\n## Security\n\nDiscovered any security issues? Please email us at infinitypaul@live.com. We promise to take it seriously, instead of\nusing the issue tracker..\n\n## Credits\n\n- [Paul Edward](https://github.com/infinitypaul)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitypaul%2Flaravel-notification-channel-termii","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinitypaul%2Flaravel-notification-channel-termii","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitypaul%2Flaravel-notification-channel-termii/lists"}