ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
### **Introduction** ### Laravel offers many extension points for you to customize the behavior of the framework's core components, or even replace them entirely. For example, the hashing facilites are defined by a ``HasherInterface`` contract, which you may implement based on your application's requirements. You may also extend the ``Request`` object, allowing you to add your own convenient "helper" methods. You may even add entirely new authentication, cache, and session drivers! Laravel components are generally extended in two ways: binding new implementations in the IoC container, or registering an extension with a ``Manager`` class, which are implementations of the "Factory" design pattern. In this chapter we'll explore the various methods of extending the framework and examine the necessary code. > ### **Methods Of Extension** ### > > Remember, Laravel components are typically extended in one of two ways: IoC bindings and the ``Manager`` classes. The manager classes serve as an implementation of the "factory" design pattern, and are responsible for instantiating driver based facilities such as cache and session. >