some packages comes pre-packed with its own models ex.Cart
but sometimes i want to add some extra logic to that model,
so instead of editing the original model or searching everywhere where this model was used and replace it with the newly created one,
i thought i would use app bind ex.
namespace App\Binders;
use some\package\Models\Cart;
class CartBinder extends Cart { // extra logic }
$this->app->bind('some\package\Models\Cart', 'App\Binders\CartBinder');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community