Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.6] Add broadcastAs method to Broadcasted Notifications #23236

Merged
merged 4 commits into from
Feb 21, 2018
Merged

[5.6] Add broadcastAs method to Broadcasted Notifications #23236

merged 4 commits into from
Feb 21, 2018

Conversation

antonkomarev
Copy link
Contributor

@antonkomarev antonkomarev commented Feb 21, 2018

Uses Notification's broadcastAs() return value for Event name and broadcasted message type if method exists.

I found it useful because of 2 things:

  1. It doesn't couple your back-end application class namespace with front-end, otherwise if you will decide to refactor namespace on back-end - you will require to reflect this changes on front-end too.
  2. It will allow us to have same behavior for Broadcasted Events nor Broadcasted Notification Events.

@GrahamCampbell GrahamCampbell changed the title [5.6] Add broadcastAs method to Broadcasted Notifications [5.6] [WIP] Add broadcastAs method to Broadcasted Notifications Feb 21, 2018
@antonkomarev
Copy link
Contributor Author

antonkomarev commented Feb 21, 2018

By second commit I've added broadcastsAs method to DatabaseChannel to keep consistency, but later understood that's not broadcasting and this method name is wrong, and reverted it back.

@antonkomarev antonkomarev changed the title [5.6] [WIP] Add broadcastAs method to Broadcasted Notifications [5.6] Add broadcastAs method to Broadcasted Notifications Feb 21, 2018
@taylorotwell taylorotwell merged commit 6626512 into laravel:5.6 Feb 21, 2018
@antonkomarev antonkomarev deleted the feature/notification-broadcast-event-name branch February 21, 2018 15:20
@lipiniak
Copy link

lipiniak commented Mar 1, 2018

Hi, is there any chance that this will be implemented to database? I got problem with that because i wont to cross use notification in models. Like Model A send notification to Model B but in database notification type is Model A, so Model B cant see it using $model->notifications method.

@antonkomarev
Copy link
Contributor Author

@lipiniak with this change #23337 you can create extended DatabaseChannel and use it in your application. Just overwrite type attribute there.

@ClaudioVarandas
Copy link

Hi, the commit 6f28b66 is merged or not ? seems not merged, at least i don't that on any 5.6/5.7 tag...
@taylorotwell can you please clarify ?

tx

@devcircus
Copy link
Contributor

@kadinho the method was renamed here: 4227bd7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants