Where does by default API hits?

  • I am wondering where the API hit first.
    I mean to say I have created a package for API only.

    But when I hit the URL, mentioned in the API package, it didn't hit there, instead of that it hit inside the Admin folder.

    So I want to know how the process works for API only.

    I want to handle all my APIs in one place. So is there any workaround for that?

  • API url are hit via api/ prefix.

  • I think you didn't get my question. What I'm trying to say is, in a simple laravel project it went to api.php folder. But where did it land on your case? I was trying to create a new API for some modules. And I found out that it is redirecting to the Admin folder route.

    I am aware of api/ prefix and it is working fine. But I've to create it under admin.php. So this is what I am asking is this where all my APIs gonna hit?

  • You can't create an admin package because they are packages that are maintained by us. If you are doing so, then updates will get interrupted due to conflicts and then you need to compatible this at your end.

    You need to use your api.php file provided by Laravel with the same route prefixes even you can override also.

  • @devansh-webkul i am using latest, version of API, and i want to make changes in API how i can do that. its located in vendor folder and i cant make changes there. what is the process of updating code for APIs ?

  • Hi there,
    You can create your custom package and override the Routes on your package.


    You can use the Bagisto API's as a package. for this first, you need to remove API from composer.json file and then update the composer.

Log in to reply