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(CaptchaService::class, function (Application $app) { return new CaptchaService( config: config('captcha', []), imageHead: $app->make(ImageHead::class), imageBody: $app->make(ImageBody::class) ); }); } /** * Bootstrap any application services. */ public function boot(): void { // } }