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');