Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/muhammadpauzi/php-rest-api-mysql
🐘 Learn to make Rest API with PHP and MySQL using OOP paradigm and design patterns. (Project of learn PHP and MySQL with PZN)
https://github.com/muhammadpauzi/php-rest-api-mysql
design-patterns mysql oop pdo php-mvc rest-api
Last synced: about 2 months ago
JSON representation
🐘 Learn to make Rest API with PHP and MySQL using OOP paradigm and design patterns. (Project of learn PHP and MySQL with PZN)
- Host: GitHub
- URL: https://github.com/muhammadpauzi/php-rest-api-mysql
- Owner: muhammadpauzi
- Created: 2021-12-20T01:50:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-01T03:46:05.000Z (about 3 years ago)
- Last Synced: 2024-11-05T19:18:36.056Z (3 months ago)
- Topics: design-patterns, mysql, oop, pdo, php-mvc, rest-api
- Language: PHP
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Rest API with MySQL
🐘 Learn to make Rest API with PHP and MySQL using OOP paradigm and design patterns. (Project of learn PHP and MySQL with PZN).## **API SPEC**
**BASE URL** : `http://localhost:8080/`
### **Users**
### Find all users
Request :
- Endpoint : `/users`
- Method : **GET**Response :
```json
{
"data": [
{
"id": "",
"name": "",
"username": "",
"email": "",
"created_at": ""
}
]
}
```### Find a user
Request :
- Endpoint : `/users/:id`
- Method : **GET**Response :
```json
{
"data": {
"id": "",
"name": "",
"username": "",
"email": "",
"created_at": ""
}
}
```### Find a user with the posts
Request :
- Endpoint : `/users/:id/posts`
- Method : **GET**Response :
```json
{
"data": {
"id": "",
"name": "",
"username": "",
"email": "",
"created_at": "",
"posts": [
{
"id": "",
"title": "",
"description": "",
"body": "",
"id_user": "",
"created_at": "",
}
]
}
}
```### **Posts**
### Find all posts
Request :
- Endpoint : `/posts`
- Method : **GET**Response :
```json
{
"data": [
{
"id": "",
"name": "",
"username": "",
"email": "",
"created_at": "",
"title": "",
"description": "",
"body": "",
"id_user": "",
"user_created_at": "",
}
]
}```
### Find a post
Request :
- Endpoint : `/posts/:id`
- Method : **GET**Response :
```json
{
"data": {
"id": "",
"name": "",
"username": "",
"email": "",
"created_at": "",
"title": "",
"description": "",
"body": "",
"id_user": "",
"user_created_at": "",
}
}
```