Skip to content

REST APIs using Slim framework. Implemented all CRUD operations on the MySql database

License

Notifications You must be signed in to change notification settings

hanoak/rest_api_with_slim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP REST API using slim framework and CRUD operations

🖐 Hi there, this is a simple REST API built using the Slim framework. And this is for the folks who are just getting started with APIs in Slim. I've built this simple REST 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

/routes/students.php folder contains all API methods for the CRUD operations

/config folder contains Mysql database configurations

/db folder contains database(.sql) file

/public folder contains a single index.php to instantiate the app.

😀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. Install Composer and run 'composer update' to install all the packages mentioned in composer.json file.

  5. Additionally, create a virtual host as mentioned in this site: Creating a virtual host in Windows

  6. Check your endpoints.

📌Endpoints

  1. http://localhost/rest_api_with_slim/students/get GET METHOD
  2. http://localhost/rest_api_with_slim/students/get/17 GET METHOD
  3. http://localhost/rest_api_with_slim/students/post POST METHOD
  4. http://localhost/rest_api_with_slim/students/put/29 PUT METHOD
  5. http://localhost/rest_api_with_slim/students/delete/29 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

REST APIs using Slim framework. Implemented all CRUD operations on the MySql database

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages