{"id":16315014,"url":"https://github.com/zingimmick/laravel-sms","last_synced_at":"2026-03-08T07:32:20.848Z","repository":{"id":38191648,"uuid":"254559831","full_name":"zingimmick/laravel-sms","owner":"zingimmick","description":"Provides sms notification channel for Laravel.","archived":false,"fork":false,"pushed_at":"2026-02-06T03:08:03.000Z","size":545,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"6.x","last_synced_at":"2026-02-06T12:46:09.465Z","etag":null,"topics":["laravel","notification","sms"],"latest_commit_sha":null,"homepage":"","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/zingimmick.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-10T06:21:55.000Z","updated_at":"2026-02-06T03:08:07.000Z","dependencies_parsed_at":"2024-03-04T09:55:39.199Z","dependency_job_id":"5b2839b9-0c0c-4944-905e-4998d9279ec3","html_url":"https://github.com/zingimmick/laravel-sms","commit_stats":{"total_commits":413,"total_committers":7,"mean_commits":59.0,"dds":0.2276029055690073,"last_synced_commit":"a471c5162e336c1ccf3b7433de6e98925a8b7b58"},"previous_names":[],"tags_count":76,"template":false,"template_full_name":null,"purl":"pkg:github/zingimmick/laravel-sms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zingimmick%2Flaravel-sms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zingimmick%2Flaravel-sms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zingimmick%2Flaravel-sms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zingimmick%2Flaravel-sms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zingimmick","download_url":"https://codeload.github.com/zingimmick/laravel-sms/tar.gz/refs/heads/6.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zingimmick%2Flaravel-sms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30248899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T05:41:50.788Z","status":"ssl_error","status_checked_at":"2026-03-08T05:41:39.075Z","response_time":56,"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":["laravel","notification","sms"],"created_at":"2024-10-10T21:55:51.475Z","updated_at":"2026-03-08T07:32:20.826Z","avatar_url":"https://github.com/zingimmick.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Sms\n\n[![Tests](https://github.com/zingimmick/laravel-sms/actions/workflows/tests.yml/badge.svg?branch=6.x)](https://github.com/zingimmick/laravel-sms/actions/workflows/tests.yml)\n[![Code Coverage](https://codecov.io/gh/zingimmick/laravel-sms/branch/6.x/graph/badge.svg)](https://codecov.io/gh/zingimmick/laravel-sms)\n[![Latest Stable Version](https://poser.pugx.org/zing/laravel-sms/v/stable.svg)](https://packagist.org/packages/zing/laravel-sms)\n[![Total Downloads](https://poser.pugx.org/zing/laravel-sms/downloads)](https://packagist.org/packages/zing/laravel-sms)\n[![Latest Unstable Version](https://poser.pugx.org/zing/laravel-sms/v/unstable.svg)](https://packagist.org/packages/zing/laravel-sms)\n[![License](https://poser.pugx.org/zing/laravel-sms/license)](https://packagist.org/packages/zing/laravel-sms)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/zingimmick/laravel-sms/badges/quality-score.png?b=6.x)](https://scrutinizer-ci.com/g/zingimmick/laravel-sms)\n[![StyleCI Shield](https://github.styleci.io/repos/254559831/shield?branch=6.x)](https://github.styleci.io/repos/254559831)\n[![Code Climate](https://api.codeclimate.com/v1/badges/9c81b0c9cdebc23ba26f/maintainability)](https://codeclimate.com/github/zingimmick/laravel-sms/maintainability)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fzingimmick%2Flaravel-sms.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fzingimmick%2Flaravel-sms?ref=badge_shield)\n\nLaravel Sms is used to notify via sms and send a message.\n\n## Thanks\n\nMany thanks to:\n\n* [JetBrains](https://www.jetbrains.com/?from=LaravelSms) for the excellent\n  **PhpStorm IDE** and providing me with an open source license to speed up the\n  project development.\n \n  [![JetBrains](/docs/jetbrains.svg)](https://www.jetbrains.com/?from=LaravelSms)\n\n## Requirements\n\n- [PHP 8.0+](https://php.net/releases/)\n- [Composer](https://getcomposer.org)\n- [Laravel 8.0+](https://laravel.com/docs/releases)\n\n## Installation\n\n### Composer\n\nExecute the following command to get the latest version of the package:\n\n```terminal\ncomposer require zing/laravel-sms\n```\n\n### Laravel\n\nPublish Configuration\n\n```shell\nphp artisan vendor:publish --provider \"Zing\\LaravelSms\\SmsServiceProvider\"\n```\n\n### Add Connections\n\nThis package based on [overtrue/easy-sms](https://github.com/overtrue/easy-sms), driver is the gateway.\n\n## Usage\n\n### Channel\n\n#### Create a Notification\n\n```php\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Notifications\\Notification;\n\nclass Verification extends Notification implements ShouldQueue\n{\n    use Queueable;\n\n    protected $code;\n\n    /**\n     * Verification constructor.\n     *\n     * @param $code\n     */\n    public function __construct($code)\n    {\n        $this-\u003ecode = $code;\n    }\n\n    public function via()\n    {\n        return ['sms'];\n    }\n\n    public function toSms($notifiable)\n    {\n        return \"验证码 {$this-\u003ecode}，您正在进行身份验证，打死也不要告诉别人哦!\";\n    }\n}\n```\n\n#### Add notification route for sms to your notifiable\n\n```php\nuse Illuminate\\Notifications\\Notifiable;\n\nclass User\n{\n    use Notifiable;\n\n    public function routeNotificationForSms($notification)\n    {\n        return $this-\u003ephone;\n    }\n}\n```\n\n#### Send notification\n\n```php\nuse Illuminate\\Support\\Facades\\Notification;\n\n$user = new User();\n// use Notifiable Trait\n$user-\u003enotify(new Verification('1111'));\n// use Notification Facade\nNotification::send($user, new Verification('1111'));\n```\n\n#### Send to anonymous notifiable\n\n```php\nuse Illuminate\\Support\\Facades\\Notification;\nuse Zing\\LaravelSms\\SmsNumber;\nuse Zing\\LaravelSms\\Channels\\SmsChannel;\n\n// use channel class name\nNotification::route(SmsChannel::class, new SmsNumber(18188888888, 86))-\u003enotify(new Verification('1111'));\n// use channel alias\nNotification::route('sms', new SmsNumber(18188888888, 86))-\u003enotify(new Verification('1111'));\n```\n\n### Facade\n\n#### Send Message\n\n```php\nuse Zing\\LaravelSms\\Facades\\Sms;\n\n// use default connection\nSms::send(18188888888, 'test message.');\n// use specific connection\nSms::connection('null')-\u003esend(18188888888, 'test message.');\n// or\nSms::via('null')-\u003esend(18188888888, 'test message.');\n```\n\n## Specific usage\n\n### Use specific connection for notification\n\n**NOTE:** Only support for `Zing\\LaravelSms\\SmsMessage`\n\n```php\nuse Zing\\LaravelSms\\SmsMessage;\n\npublic function toSms($notifiable)\n{\n    return (new SmsMessage())-\u003eonConnection('log');\n}\n```\n\n### Make PhoneNumber notifiable\n\n**NOTE:** Only support for `Zing\\LaravelSms\\SmsNumber`\n\n```php\nuse Zing\\LaravelSms\\SmsNumber;\n\n(new SmsNumber(18188888888))-\u003enotify(new Verification('1111'));\n```\n\n## License\n\nLaravel Sms is open-sourced software licensed under the [MIT license](LICENSE).\n\n\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fzingimmick%2Flaravel-sms.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fzingimmick%2Flaravel-sms?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzingimmick%2Flaravel-sms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzingimmick%2Flaravel-sms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzingimmick%2Flaravel-sms/lists"}