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

Merged
merged 1 commit into from Jan 6, 2020
Merged

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

merged 1 commit into from Jan 6, 2020

Conversation

paulhenri-l
Copy link
Contributor

@paulhenri-l 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants