Custom Bindings

In some of your applications that use the Varbox platform, you might find the need to overwrite, customize or extend functionalities that come with the platform, in order to match your needs.

In its underlying implementation, the Varbox platform uses a lot of classes, each serving its own purpose in different parts of the system.

Throughout these classes, the following support being overwritten by you:

services models controllers form requests view composers middleware helpers filters sorts

A very important thing to note here is that you can overwrite any of these platform classes with your own implementations.

You can find all platform classes that support overwrites inside the config/varbox/bindings.php config file. You should update the config key of the class you want to overwrite with your own class' fully qualified namespace.

It's very encouraged that you read the doc block comments above the config key you wish to overwrite, because it provides useful insight on how to extend it.

When overwriting a platform class, you have two options:

Either way, you're required to implement the contract (if the original platform class implements one), because the platform, at service provider level, will bind a concrete implementation to that contract, so without the contract implemented, nothing will happen.