Skip to content

PHP REST API without using any frameworks. Contains all CRUD operations.

License

Notifications You must be signed in to change notification settings

hanoak/php_rest_api_without_framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  2. http://localhost/php_rest_api_without_framework/api/get_one.php GET METHOD
  3. http://localhost/php_rest_api_without_framework/api/post.php POST METHOD
  4. http://localhost/php_rest_api_without_framework/api/put.php PUT METHOD
  5. http://localhost/php_rest_api_without_framework/api/delete.php DELETE METHOD

📰License

MIT

❤️Loved this project?

Please give me a star⭐ to this repo, I'll be happy😊.

🔗 Let's connect!

linkedin

twitter

twitter

medium

About

PHP REST API without using any frameworks. Contains all CRUD operations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages