Sample PHP API based on Laravel Framework
You can give it a try at: https://jessie365/api/{command}
1. Register user:
CREATE POST Request to URL: hostname/api/users
The body of the request must contain these fields in JSON format:
- name
- password
- password_confirmation
CREATE POST Request to URL: hostname/api/auth
The body of the request must contain these fields in JSON format:
- password
3. Create Post:
CREATE POST Request to URL: hostname/api/posts
The body of the request must contain these fields in JSON format:
- title
- body
name: 'Authorization'; value: 'Bearer {TOKEN_HERE}'
4. Create Comment:
CREATE POST Request to URL: hostname/api/posts/{postId}/comments
The body of the request must contain these fields in JSON format:
- body
name: 'Authorization'; value: 'Bearer {TOKEN_HERE}'
5. Show list of posts:
CREATE GET Request to URL: hostname/api/posts
RETURNS: List of posts ordered by creation date DESCENDING
PARAMS: Use hostname/api/posts/?orderBy=comments to get a list of posts ordered by most comments