From a7d0202f278a85459b140660651d2bfc57f94e95 Mon Sep 17 00:00:00 2001 From: salahhusa9 Date: Sun, 7 Feb 2021 15:24:33 +0100 Subject: [PATCH] How To Get The User ID (userId) --- README.md | 14 ++++++++++++++ resources/view/userid.blade.php | 15 +++++++++++++++ src/OneSignalServiceProvider.php | 1 + 3 files changed, 30 insertions(+) create mode 100644 resources/view/userid.blade.php diff --git a/README.md b/README.md index 5bd8302..6f4be28 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,20 @@ You can send a message based on a set of tags with the command ); ``` +### How To Get The User ID ($userId) + +To obtain the user ID, you must use the code below in the middle of the form, and it will be sent as OneSignalUserId, you can use it when logging in or ... + +```php + @include('OneSignal::userid') +``` +include is this input : +```html + +... + +``` + ### Sending a Notification To A Specific User After storing a user's tokens in a table, you can simply send a message with diff --git a/resources/view/userid.blade.php b/resources/view/userid.blade.php new file mode 100644 index 0000000..1e340d2 --- /dev/null +++ b/resources/view/userid.blade.php @@ -0,0 +1,15 @@ + + \ No newline at end of file diff --git a/src/OneSignalServiceProvider.php b/src/OneSignalServiceProvider.php index 828219a..56d2239 100644 --- a/src/OneSignalServiceProvider.php +++ b/src/OneSignalServiceProvider.php @@ -14,6 +14,7 @@ class OneSignalServiceProvider extends ServiceProvider public function boot() { $configPath = __DIR__ . '/../config/onesignal.php'; + $this->loadViewsFrom(__DIR__.'/../resources/views', 'OneSignal'); $this->publishes([$configPath => config_path('onesignal.php')], 'config'); $this->mergeConfigFrom($configPath, 'onesignal');