Bagisto Forum

    Bagisto

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

    How can override routes, models, controllers?

    Modules
    2
    2
    1068
    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.
    • A
      AN-Varit last edited by

      I need to override:

      • Some admin routes which located in packages/Webkul/Admin/src/Http/routes.php
      • Some category controller methods which located in packages/Webkul/Category/src/Http/Controllers/CategoryController.php
      • Category model to add an attribute to it

      What is the best practice to do that?
      Thanks a lot for helping and giving good advises

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

        In simple, just assume you are overriding the vendor folder. How will you do it?

        • First, if you building some package then overriding inside your package.

        • Second, Laravel app folder where everything is already registered for you. Just register the same route in the web.php file and transfer your route to the controller where you want. Laravel always hit the top-level route.

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