Override Repository



  • What is the correct way to override a repository in Bagisto. I'm trying to add additional function to the ProductFlatRepository. I know how to override a model correctly but I keep getting an error when trying to override a repository about a missing Proxy class.

    This is the code I currently have in the boot method of my serviceProvider in my custom package

    $this->app->concord->registerModel(
                \Webkul\Product\Repositories\ProductFlatRepository::class, \Particular\Product\Repositories\ProductFlatRepository::class
            );
    

    This is the error message I'm seeing.

    Class 'Webkul\Product\Models\ProductFlatRepositoryProxy' not found
    


  • Hi @fab5freddy,

    The error clearly simple you forget to create the ProductFlatRepositoryProxy or something not registered in the module service provider.

    Please check once again.


Log in to reply