HorizonServiceProvider.php 999 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace App\Providers;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Support\Facades\Gate;
  5. use Laravel\Horizon\Horizon;
  6. use Laravel\Horizon\HorizonApplicationServiceProvider;
  7. class HorizonServiceProvider extends HorizonApplicationServiceProvider
  8. {
  9. /**
  10. * Bootstrap any application services.
  11. *
  12. * @return void
  13. */
  14. public function boot()
  15. {
  16. parent::boot();
  17. // Horizon::routeSmsNotificationsTo('15556667777');
  18. // Horizon::routeMailNotificationsTo('example@example.com');
  19. // Horizon::routeSlackNotificationsTo('slack-webhook-url', '#channel');
  20. // Horizon::night();
  21. }
  22. /**
  23. * Register the Horizon gate.
  24. *
  25. * This gate determines who can access Horizon in non-local environments.
  26. *
  27. * @return void
  28. */
  29. protected function gate()
  30. {
  31. Gate::define('viewHorizon', function ($user) {
  32. return in_array($user->email, [
  33. //
  34. ]);
  35. });
  36. }
  37. }