[ SendExportReportEmail::class, ], ImportCompleted::class => [ SendImportReportEmail::class, ], UserWasPurged::class => [ RemoveUserFiles::class, ], ]; public function register(): void { $this->app->register(RelationshipServiceProvider::class); $this->app->register(ViewServiceProvider::class); // Tell Laravel: "Whenever someone asks for GetSystemSettings, // give them the exact same object instance for the entire request." $this->app->singleton(GetSystemSettings::class, function ($app) { return new GetSystemSettings; }); } public function boot(): void { $this->registerEvents(); Carbon::macro('toUserTz', fn () => $this->copy() ->tz(config('app.display_timezone', 'UTC'))); Builder::macro('whereRelationUlid', function ($relation, $ulid) { return $this->whereHas($relation, fn($builder) => $builder->where('ulid', $ulid)); }); Str::macro('initials', function (string $name, int $limit = 2) { $words = explode(' ', trim($name)); $initials = collect($words)->map(function ($word) { return substr($word, 0, 1); })->take($limit)->implode(''); return strtoupper($initials); }); } }