Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
String events are especially useful for passing custom data to the listener. Consider the following: ```php use Native\Laravel\Client\Client; use Native\Laravel\Notification; // Send a notification with a custom event $client = new Client(); $notification = new Notification($client); $articleId = 1; $notification->title('EXTRA EXTRA READ ALL ABOUT IT') ->message('You should totally click this) ->event('notification.clicked.newArticle' . $articleId) ->show(); // Listen to the notification Event::listen('notification.clicked.newArticle.*', function ($event) { $event = explode('.', $event) $articleId = array_last($event); // do stuff... }); ```
- Loading branch information