AppServiceProvider.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace App\Providers;
  3. use App\Models\Client;
  4. use App\Models\Notification;
  5. use App\Models\Provider;
  6. use App\Models\Schedule;
  7. use App\Models\ServicePackage;
  8. use App\Observers\ClientObserver;
  9. use App\Observers\NotificationObserver;
  10. use App\Observers\ProviderObserver;
  11. use App\Observers\ScheduleObserver;
  12. use App\Observers\ServicePackageObserver;
  13. use Illuminate\Support\ServiceProvider;
  14. class AppServiceProvider extends ServiceProvider
  15. {
  16. /**
  17. * All of the container bindings that should be registered.
  18. *
  19. * @var array
  20. */
  21. public $bindings = [
  22. // Add bindings here...
  23. ];
  24. /**
  25. * Register any application services.
  26. */
  27. public function register(): void
  28. {
  29. //
  30. }
  31. /**
  32. * Bootstrap any application services.
  33. */
  34. public function boot(): void
  35. {
  36. Client::observe(ClientObserver::class);
  37. Notification::observe(NotificationObserver::class);
  38. Provider::observe(ProviderObserver::class);
  39. ServicePackage::observe(ServicePackageObserver::class);
  40. if ($this->app->environment(['local', 'development', 'dev'])) {
  41. Schedule::observe(ScheduleObserver::class);
  42. }
  43. }
  44. }