lundi 5 décembre 2016

Laravel 5.3 - Internal redirect or modify request middleware

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?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2gXDohJ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire