forked from laravel/laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move broadcast channel registration to a routes file.
These are very similar to routes in that they are channel endpoints that your application supports and they also fully support route model binding in Laravel 5.4. Upgraded applications do not need to make this change if they do not want to.
- Loading branch information
1 parent
b748931
commit 52f0196
Showing
3 changed files
with
18 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Broadcast Channels | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Here you may register all of the event broadcasting channels that your | ||
| application supports. The given channel authorization callbacks are | ||
| used to check if an authenticated user can listen to the channel. | ||
| | ||
*/ | ||
|
||
Broadcast::channel('App.User.{id}', function ($user, $id) { | ||
return (int) $user->id === (int) $id; | ||
}); |