AppServiceProvider.php 903 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Providers;
  3. use App\Notification\DingDingRobot;
  4. use Illuminate\Pagination\Paginator;
  5. use Illuminate\Support\Facades\Schema;
  6. use Illuminate\Support\ServiceProvider;
  7. class AppServiceProvider extends ServiceProvider
  8. {
  9. /**
  10. * Bootstrap any application services.
  11. *
  12. * @return void
  13. */
  14. public function boot()
  15. {
  16. //
  17. Schema::defaultStringLength(191);
  18. // Laravel 5.7兼容的分页设置
  19. Paginator::defaultView('vendor.pagination.bootstrap-4');
  20. Paginator::defaultSimpleView('vendor.pagination.simple-bootstrap-4');
  21. }
  22. /**
  23. * Register any application services.
  24. *
  25. * @return void
  26. */
  27. public function register()
  28. {
  29. $this->app->singleton(DingDingRobot::class, function () {
  30. return new DingDingRobot(env('DINGDING_ACCESS_TOKEN'), env('DINGDING_SECRET'));
  31. });
  32. }
  33. }