How can I override a whole package like i want to override velocity package with my custom package
-
I want to override modules like velocity,sales etc so that whatever customization i m doing it does not affect when i am updating the code with your new release.
-
Hi @suchitra-singh98
You have to register you package here :
https://github.com/bagisto/bagisto/blob/master/config/app.php#L284
https://github.com/bagisto/bagisto/blob/master/composer.json#L107 -
If you are doing customization that means compatibility needs to be handled by your hand with every release.
And for overriding the packages it is the same as Laravel.
And if you creating the whole new package then you can follow this doc as well,
https://devdocs.bagisto.com/1.x/packages/create-package.html -
@devansh-webkul but we will only be managing the customized package or newly created package by our end the base modules will be updated smoothly i guess if we are overriding the packages now ?
-
Yes core packages will update smoothly unless and until you are doing changes in the core packages.
-
@devansh-webkul ,So if i want to customized shop package then I am creating the copy of shop package with different name (CustomShop) and did the changes accordingly in composer.json and app.php file for registering the new package .
So now both package will be visible on admin side but i only want to have the new one as all the needed customization and updated code will be there so in that case i need to remove shop from composer.json and app.php file or is there any other way of overriding it ? -
No need to do this as this will break the latest updates. Just create your own package and change the routes method to your new package controller where you want to update.
For extra classes, you can change binding in the provider as well.
And for the view portion, you can customize it in the resource folder or you can place it in your package and then publish it to the resource folder.
There is no bagisto thing here. It is purely Laravel and OOPs concept based upon how you manage your code.