laravel-shopr
laravel-shopr copied to clipboard
Allows to configure routes
Is your feature request related to a problem? Please describe. The route paths and middleware can't be configured atm.
Describe the solution you'd like Update config to support route path and middleware similar to laravel/telescope
Thanks for your request! Could you please provide a bit more detail on how you'd like it to work? Is it the API route prefix you'd like to change or the other routes?
I want to change the both route prefix and paths, apply my middleware. And also, I want to add my own logic since I dont want to use fully qualified class name for shoppable_type in order_items table so I'm using morphMap to customize polymorphic types, transform data to my desire response format. Ideally, I think you shouldn't register routes automatically. You could use the route macro to add your method i.e Route::cart() similar to Route::auth() from Laravel so developers can decide whether the route should be registered.
Right. I'll make the middleware and prefixes + paths configurable in the next release.
I'm currently working on a public API for managing the cart without using the REST API, when that's done I was planning on making the REST API optional. Is that what you meant?
Yes, please. Giving developers more power to do whatever they want