Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How can I override a whole package like i want to override velocity package with my custom package

    Modules
    3
    7
    2981
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      suchitra.singh98 last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • sanjay-webkul
        sanjay-webkul last edited by

        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

        1 Reply Last reply Reply Quote 0
        • devansh-webkul
          devansh-webkul last edited by

          Hi @suchitra-singh98,

          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

          S 1 Reply Last reply Reply Quote 0
          • S
            suchitra.singh98 @devansh-webkul last edited by

            @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 ?

            1 Reply Last reply Reply Quote 0
            • devansh-webkul
              devansh-webkul last edited by

              Yes core packages will update smoothly unless and until you are doing changes in the core packages.

              1 Reply Last reply Reply Quote 0
              • S
                suchitra.singh98 last edited by suchitra.singh98

                @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 ?

                1 Reply Last reply Reply Quote 0
                • devansh-webkul
                  devansh-webkul last edited by

                  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.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post