AppServiceProvider.php 664 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Providers;
  3. use Illuminate\Routing\UrlGenerator;
  4. use Illuminate\Support\Facades\Validator;
  5. use Illuminate\Support\ServiceProvider;
  6. class AppServiceProvider extends ServiceProvider
  7. {
  8. /**
  9. * Register any application services.
  10. *
  11. * @return void
  12. */
  13. public function register()
  14. {
  15. //
  16. }
  17. /**
  18. * Bootstrap any application services.
  19. *
  20. * @return void
  21. */
  22. public function boot(UrlGenerator $url)
  23. {
  24. Validator::extend('recaptcha', 'App\\Validators\\ReCaptcha@validate');
  25. if ( config('app.env') !== 'local') {
  26. $url->forceScheme('https');
  27. }
  28. }
  29. }