app->bind(ImageManagerContract::class, function () { return new ImageManager(imageClassName: config('captcha.imageClass')); }); $this->app->bind(ImageHead::class, Head::class); $this->app->bind(ImageBody::class, Body::class); $this->app->bind(ImageLines::class, Lines::class); $this->app->bind(CryptographyContract::class, CryptographyString::class); $this->app->bind(CreateSearchInstanceCommand::class, function () { return new CreateSearchInstanceCommand(Search::class); }); $this->app->bind(CaptchaGenerateService::class, function (Application $app) { return new CaptchaGenerateService( config: config('captcha', []), imageHead: $app->make(ImageHead::class), imageBody: $app->make(ImageBody::class) ); }); $this->app->bind(CaptchaTokenHandler::class, function (Application $app) { return new CaptchaTokenHandler( generatePublicTokenCommand: $app->make(GenerateTokenUlidCommand::class), generatePrivateTokenCommand: $app->make(GenerateTokenUuidCommand::class) ); }); } /** * Bootstrap any application services. */ public function boot(): void { Password::defaults(function () { $rule = Password::min(8); return $this->app->isProduction() ? $rule->letters() ->mixedCase() ->numbers() ->symbols() ->uncompromised() : $rule; }); Paginator::useBootstrapFive(); } }