AppServiceProvider.php 654 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Providers;
  3. use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider;
  4. use Illuminate\Support\ServiceProvider;
  5. use URL;
  6. class AppServiceProvider extends ServiceProvider {
  7. /**
  8. * Register any application services.
  9. *
  10. * @return void
  11. */
  12. public function register() {
  13. if($this->app->environment() !== 'production'){
  14. $this->app->register(IdeHelperServiceProvider::class);
  15. }
  16. }
  17. /**
  18. * Bootstrap any application services.
  19. *
  20. * @return void
  21. */
  22. public function boot() {
  23. // 检测是否强制跳转https
  24. if(env('REDIRECT_HTTPS', false)){
  25. URL::forceScheme('https');
  26. }
  27. //\Schema::defaultStringLength(191);
  28. }
  29. }