Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Add redis.connection aliases in container #31034



Copy link

paulhenri-l commented Jan 5, 2020

In order to add on these improvements:

I've added two aliases to the redis.connection binding.

These aliases are:

  • \Illuminate\Redis\Connections\Connection::class
  • \Illuminate\Contracts\Redis\Connection::class

It will then allow anyone to type hint on the redis Connection class or Contract and let the container resolve the correct connection implementation.

This behavior will also be consistent with the database one.

One other advantage of doing this is that developers won't need to type hint on the lower level RedisManager class. This will result in code that is less coupled to the framework internals.

@GrahamCampbell GrahamCampbell changed the title Add redis.connection aliases in container [6.x] Add redis.connection aliases in container Jan 5, 2020
@taylorotwell taylorotwell merged commit fb9446f into laravel:6.x Jan 6, 2020
2 checks passed
2 checks passed
continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.