123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace App\Providers;
- use App\Contracts\PermissionMiddleware;
- use App\Http\Middleware\AdminPermission;
- use App\Models\Area;
- use App\Models\Bike;
- use App\Models\Parking;
- use App\Observers\AreaObserver;
- use App\Observers\BikeObserver;
- use App\Observers\ParkingObserver;
- use Illuminate\Http\Resources\Json\Resource;
- use Illuminate\Support\Facades\Log;
- use Illuminate\Support\ServiceProvider;
- use Overtrue\EasySms\EasySms;
- class AppServiceProvider extends ServiceProvider
- {
- /**
- * Register any application services.
- *
- * @return void
- */
- public function register()
- {
- //
- if ($this->app->isLocal()) {
- $this->app->register(TelescopeServiceProvider::class);
- }
- $this->app->singleton('easy_sms', function ($app) {
- $config = config('easySms');
- return (new EasySms($config));
- });
- }
- /**
- * Bootstrap any application services.
- *
- * @return void
- */
- public function boot()
- {
- Resource::withoutWrapping();
- $this->app->singleton(PermissionMiddleware::class, function () {
- return new AdminPermission();
- });
- Bike::observe(BikeObserver::class);
- Area::observe(AreaObserver::class);
- Parking::observe(ParkingObserver::class);
- }
- }
|