Skip to content

[5.6] Add broadcastAs method to Broadcasted Notifications#23236

Merged
taylorotwell merged 4 commits into
laravel:5.6from
cybercog:feature/notification-broadcast-event-name
Feb 21, 2018
Merged

[5.6] Add broadcastAs method to Broadcasted Notifications#23236
taylorotwell merged 4 commits into
laravel:5.6from
cybercog:feature/notification-broadcast-event-name

Conversation

@antonkomarev

@antonkomarev antonkomarev commented Feb 21, 2018

Copy link
Copy Markdown
Contributor

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

antonkomarev commented Feb 21, 2018

Copy link
Copy Markdown
Contributor Author

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

lipiniak commented Mar 1, 2018

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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