How to create a public route in addons, not in common config folder?

I found there is a way we can add public route under /config/api/public/ folder.

However, as I’m building an addon, I want to add a public route inside it, how can I create it without touching a common config folder? Thanks in advance.

in the bootstrap.php file of your addon:


$this->bind('/my/custom/route/:id', function($params) {
   return $params;
});
1 Like

I I’m trying to use bramus/router right now. Has already worked in extensions.