Bagisto Forum

    Bagisto

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

    Best Way to Modify Route & Controller

    General Discussion
    3
    7
    827
    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.
    • J
      jc last edited by

      Will it be safe to modify files in \packages\Webkul?

      How should I modify route and controller in \packages\Webkul\Shop\src\Http?

      1 Reply Last reply Reply Quote 0
      • D
        deepak227 last edited by

        Hi @jc

        Can you clarify what actually you want to do with route and controller ?

        1 Reply Last reply Reply Quote 0
        • J
          jc last edited by

          I need to display catalog following inventory source, each catalog will show different info, e.g: different banner, different promotion image and etc.
          may need to add new route and modify some part of controllers

          E.g:
          http://example.com/shop/usa
          http://example.com/shop/india
          http://example.com/shop/china

          1 Reply Last reply Reply Quote 0
          • D
            deepak227 last edited by

            hi @jc

            yes @jc you can overide the controller and route.

            After that please run the command when you overide the files.

            The Commands are
            php artisan config:cache
            php artisan cache:clear
            php artisan route:cache

            Hope this will work for you.

            Thank you

            Best Regards
            Deepak Singh Gusain

            1 Reply Last reply Reply Quote 0
            • J
              jc last edited by

              Can I know how the proper way to override the route and controller?

              1 Reply Last reply Reply Quote 0
              • D
                deepak227 last edited by

                Hi @jc

                For routes
                go to the package , then search for the route file check how the routes are define.
                define your own route and then save that file.

                For Controller
                go to the package , then search for controller add the function or override the function whatever you want and then save that file.

                At last after saving the files please run the above command and check the result.

                Thank you

                1 Reply Last reply Reply Quote 0
                • Z
                  zainawan99 last edited by

                  Please any code example how can override the controller and route Please sent best away to extend controller webkul?

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