loadMigrationsFrom([realpath(__DIR__ . '/../Database/migrations')]); // $this->app->make(EloquentFactory::class)->load(realpath(__DIR__ . '/../Database/factories')); $this->mergeConfigFrom(realpath(__DIR__ . '/../config.php'), 'domain.captcha'); // Validator extensions $this->app['validator']->extend('captcha', function ($attribute, $value, $parameters) { return app(CaptchaService::class)->check($value, $parameters[0]); }); // Bind captcha $this->app->bind('captcha', function ($app) { $config = new Repository($app['config']['domain']); return new CaptchaService( $app['Illuminate\Filesystem\Filesystem'], $config, $app['Intervention\Image\ImageManager'], $app['Illuminate\Hashing\BcryptHasher'], $app['Illuminate\Support\Str'] ); }); } /** * 注册一个服务提供者 * * @return void */ public function register() { $this->app->register(RouteServiceProvider::class); $this->app->register(MiddlewareServiceProvider::class); } }