-
app/Providers/AppServiceProvider.php
Open in GitHubuse App\Repositories\GithubSponsorRepository; use Illuminate\Support\ServiceProvider; use Kevinrob\GuzzleCache\CacheMiddleware; use Kevinrob\GuzzleCache\Storage\LaravelCacheStorage; use Kevinrob\GuzzleCache\Strategy\PrivateCacheStrategy; use Stillat\Numeral\Languages\LanguageManager; use Illuminate\Support\Facades\Cache; class AppServiceProvider extends ServiceProvider { public function register(): void { $this->app->singleton(Numeral::class, static function (): Numeral { $numeral = new Numeral(); $numeral->setLanguageManager(new LanguageManager()); return $numeral; }); $this->app->singleton(CacheMiddleware::class, function (): CacheMiddleware { return new CacheMiddleware( new PrivateCacheStrategy( new LaravelCacheStorage( Cache::store() ) ) ); }); $this->app->singleton(GithubSponsorRepository::class); } // }