123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Providers;
- use App\Models\BlockItems;
- use App\Models\ContractDistribution;
- use App\Observers\BlockItemObserver;
- use App\Observers\ContractDistributionObserver;
- use App\Observers\CouponGrantRangeObserver;
- use App\Observers\CouponRangeObserver;
- use App\Observers\GoodsSpecObserver;
- use Illuminate\Contracts\Routing\UrlGenerator;
- use Illuminate\Support\ServiceProvider;
- class AppServiceProvider extends ServiceProvider
- {
- /**
- * Register any application services.
- *
- * @return void
- */
- public function register()
- {
- //
- }
- /**
- * Bootstrap any application services.
- *
- * @return void
- */
- public function boot(UrlGenerator $url)
- {
- // 设置全局https
- if( strtolower(env('APP_ENV')) !== 'local' ){
- $url->forceScheme('https');
- }
- //商品规格库存更新触发事件
- BlockItems::observe(BlockItemObserver::class);
- ContractDistribution::observe(ContractDistributionObserver::class);
- }
- }
|