I am building an API with Laravel 5.3. I have routes such as /users/1, users/1/teams etc.
I'd like client applications to also be able to use URIs like /users/self, /users/self/teams.
I was looking into building a middleware that checks to see if /self/ is in the request URI, and if it is, then change /self/ to the user's actual id, or do an internal redirect to the requested endpoint.
Any ideas on how I could do this?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire