Developers building web application often runs into dilemma of URL structuring. One of the main occurs in doing sort and its order.
Rather than using something like this in URL
1 | http://laravelnepal.com/api/v1/posts?sort=created_at&orderBy=desc |
We can simply shorten like this.
1 | http://laravelnepal.com/api/v1/posts?sort=-created_at |
Everything is awesome.