Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hc0127/journey


https://github.com/hc0127/journey

Last synced: 7 days ago
JSON representation

Awesome Lists containing this project

README

        

# PHP REST API without any framework and CRUD operations

🖐 Hi there, this is a simple REST API built in PHP without using any frameworks. This is built for the folks who are just getting started with APIs. As we all know that first working on core PHP gains a lot of knowledge on API, rather than jumping directly and relying on frameworks. So, I've built this simple PHP API that contains all CRUD operations. As an example, I've taken a student database with just name, address, and age as its table columns and have performed CRUD operations on it using APIs. Feel free to use this code and work around it. Hope you got the insights!

## 📧Contents

***/api*** folder contains all PHP files for the CRUD operations

***/config*** folder contains Mysql database configurations

***/db*** folder contains database(.sql) file

***/models*** folder contains a single *Student.php* for database logic

## 😀How to use this project

1. Well, first clone or download this repo.

2. Create a database and import ***db/studentdb.sql*** file in your database.

3. Change database configurations in ***config/Database.php*** file.

4. Check your endpoints.

## 📌Endpoints

1. `http://localhost/php_rest_api_without_framework/api/get.php`
![GET METHOD](https://images2.imgbox.com/6d/6f/aomASYok_o.jpg)
2. `http://localhost/php_rest_api_without_framework/api/get_one.php`
![GET METHOD](https://images2.imgbox.com/08/d1/vAME2bJ3_o.jpg)
3. `http://localhost/php_rest_api_without_framework/api/post.php`
![POST METHOD](https://thumbs2.imgbox.com/52/04/yD6d2GYK_t.jpg)
4. `http://localhost/php_rest_api_without_framework/api/put.php`
![PUT METHOD](https://images2.imgbox.com/20/a2/Lg4U2hNS_o.jpg)
5. `http://localhost/php_rest_api_without_framework/api/delete.php`
![DELETE METHOD](https://images2.imgbox.com/c5/89/2s8M7yr0_o.jpg)
## 📰License

[MIT](https://choosealicense.com/licenses/mit/)


## ❤️Loved this project?
Please give me a **star**⭐ to this repo, I'll be happy😊.

## 🔗 Let's connect!

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white&style=plastic)](https://www.linkedin.com/in/hanoak/)

[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white&style=plastic)](https://twitter.com/_hanoak)

[![twitter](https://img.shields.io/badge/YouTube-red?style=for-the-badge&logo=youtube&logoColor=white&style=plastic)](https://www.youtube.com/channel/UCgqAS2Phb6DNyGD-8n7Jg-Q/?sub_confirmation=1)

[![medium](https://img.shields.io/badge/Medium-000?style=for-the-badge&logo=medium&logoColor=white&style=plastic)](https://medium.com/@hanoak)"# journey"