protected function registerEncrypter()
    {
        $this->app->singleton('encrypter', function ($app) {
            $key    = $app['config']->get('app.key');
            $cipher = $app['config']->get('app.cipher');
            if (empty($key)) {
                throw new \RuntimeException('No application encryption key has been specified.');
            }

            // If the key starts with "base64:", we will need to decode the key before handing
            // it off to the encrypter. Keys may be base-64 encoded for presentation and we
            // want to make sure to convert them back to the raw bytes before encrypting.
            if (Str::startsWith($key, 'base64:')) {
                $key = base64_decode(substr($key, 7));
            }

            return new Encrypter($key, $cipher);
        });

        $this->app->singleton('bcrypt', function ($app) {
            return new BcryptHasher($app['config']->get('encrypter', []));
        });
    }