BroadcastServiceProvider.php 597 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Providers;
  3. use Illuminate\Support\ServiceProvider;
  4. use Illuminate\Support\Facades\Broadcast;
  5. class BroadcastServiceProvider extends ServiceProvider
  6. {
  7. /**
  8. * Bootstrap any application services.
  9. *
  10. * @return void
  11. */
  12. public function boot()
  13. {
  14. Broadcast::route(['middleware' => ['web']]);
  15. Broadcast::auth('channel-name.*', function ($user, $id) {
  16. return true;
  17. });
  18. }
  19. /**
  20. * Register any application services.
  21. *
  22. * @return void
  23. */
  24. public function register()
  25. {
  26. //
  27. }
  28. }