{"id":20558829,"url":"https://github.com/multicaret/laravel-onesignal","last_synced_at":"2025-04-14T13:43:38.569Z","repository":{"id":62517142,"uuid":"118595761","full_name":"multicaret/laravel-onesignal","owner":"multicaret","description":null,"archived":false,"fork":false,"pushed_at":"2019-04-30T09:11:09.000Z","size":10,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T02:47:21.533Z","etag":null,"topics":["custom-notification","laravel","laravel-notification-channels","laravel-notifications","notifications","onesignal","onesignal-php"],"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/multicaret.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}},"created_at":"2018-01-23T10:36:51.000Z","updated_at":"2023-03-12T02:31:15.000Z","dependencies_parsed_at":"2022-11-02T16:00:55.566Z","dependency_job_id":null,"html_url":"https://github.com/multicaret/laravel-onesignal","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multicaret%2Flaravel-onesignal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multicaret%2Flaravel-onesignal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multicaret%2Flaravel-onesignal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multicaret%2Flaravel-onesignal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multicaret","download_url":"https://codeload.github.com/multicaret/laravel-onesignal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248890226,"owners_count":21178385,"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":["custom-notification","laravel","laravel-notification-channels","laravel-notifications","notifications","onesignal","onesignal-php"],"created_at":"2024-11-16T03:47:10.266Z","updated_at":"2025-04-14T13:43:38.531Z","avatar_url":"https://github.com/multicaret.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  OneSignal Push Notifications for Laravel 5\n\n## Introduction\n\nThis is a simple OneSignal wrapper library for Laravel. It simplifies the basic notification flow with the defined methods. You can send a message to all users or you can notify a single user. \nBefore you start installing this service, please complete your OneSignal setup at https://onesignal.com and finish all the steps that is necessary to obtain an application id and REST API Keys.\n\n\n## Installation\n\nFirst, you'll need to require the package with Composer:\n\n```sh\ncomposer require liliom/laravel-onesignal\n```\n\n### Laravel 5.5 and up\n\nYou don't have to do anything else, this package uses the Package Auto-Discovery feature, and should be available as soon as you install it via Composer.\n\n### Laravel 5.4 and down\n\nUpdate your `config/app.php` by adding the following service provider.\n\n```php\n'providers' =\u003e [\n\t// ...\n\t// ...\n\tLiliom\\OneSignal\\OneSignalServiceProvider::class,\n\t// ...\n];\n```\n\n\nThen, register class alias by adding an entry in aliases section\n\n```php\n'aliases' =\u003e [\n\t// ...\n\t'OneSignal' =\u003e Liliom\\OneSignal\\OneSignalFacade::class\n];\n```\n\n\nFinally, publish the config file by running:\n\n```\nphp artisan vendor:publish --provider=\"Liliom\\OneSignal\\OneSignalServiceProvider\"\nphp artisan vendor:publish --provider=\"Laravelme\\Acquaintances\\AcquaintancesServiceProvider\"\n``` \n \nThe command above shall publish a configuration file named `onesignal.php` which includes your OneSignal authorization keys.\n\n\n## Configuration\n\nPlease fill the file `config/onesignal.php`.\n`app_id` is your *OneSignal App ID* and `rest_api_key` is your *REST API Key*, where `user_auth_key` is optional.\n \nOr alternatively you can fill your settings in `.env` file as the following:\n```\nONE_SIGNAL_APP_ID=\nONE_SIGNAL_REST_API_KEY=\n```\n\n## Usage\n\n### Sending a Notification To All Users\n\nYou can easily send a message to all registered users with the command\n\n    OneSignal::sendNotificationToAll(\"Some Message\", $url = null, $data = null, $buttons = null, $schedule = null);\n    \n`$url` , `$data` , `$buttons` and `$schedule` fields are exceptional. If you provide a `$url` parameter, users will be redirecting to that url.\n    \n\n### Sending a Notification based on Tags/Filters\n\nYou can send a message based on a set of tags with the command\n\n    OneSignal::sendNotificationUsingTags(\"Some Message\", [\"key\" =\u003e \"device_uuid\", \"relation\" =\u003e \"=\", \"value\" =\u003e 123e4567-e89b-12d3-a456-426655440000], $url = null, $data = null, $buttons = null, $schedule = null);\n\n\n### Sending a Notification To A Specific User\n\nAfter storing a user's tokens in a table, you can simply send a message with\n\n    OneSignal::sendNotificationToUser(\"Some Message\", $userId, $url = null, $data = null, $buttons = null, $schedule = null);\n    \n`$userId` is the user's unique id where he/she is registered for notifications. Read https://documentation.onesignal.com/docs/web-push-tagging-guide for additional details.\n`$url` , `$data` , `$buttons` and `$schedule` fields are exceptional. If you provide a `$url` parameter, users will be redirecting to that url.\n\n### Sending a Notification To A Specific User via Email Address\n\nIf you are using the option to set the userId as email address of the user then use the following function\n\n    OneSignal::sendNotificationToUserByEmail(\"Some Message\", $email, $filters = [], $segment = ['All'], $url = null, $data = null, $buttons = null, $schedule = null, $smallIcon = null, $LargeIcon = null, $bigPicture = null, $androidAccentCircleColor = null, $androidAccentLedColor = null, $sound = null )\n\n\n### Sending a Notification To Segment\n\nYou can simply send a notification to a specific segment with\n\n    OneSignal::sendNotificationToSegment(\"Some Message\", $segment, $url = null, $data = null, $buttons = null, $schedule = null);\n    \n`$url` , `$data` , `$buttons` and `$schedule` fields are exceptional. If you provide a `$url` parameter, users will be redirecting to that url.\n\n### Sending a Custom Notification\n\nYou can send a custom message with \n\n    OneSignal::sendNotificationCustom($parameters);\n    \n    ### Sending a Custom Notification\n### Sending a async Custom Notification\nYou can send a async custom message with \n\n    OneSignal::async()-\u003esendNotificationCustom($parameters);\n    \nPlease refer to https://documentation.onesignal.com/reference for all customizable parameters.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulticaret%2Flaravel-onesignal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmulticaret%2Flaravel-onesignal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulticaret%2Flaravel-onesignal/lists"}