Simple REST API for employee management system made by using laravel.
-
Clonning the repo
git clone https://github.com/Besufikad17/eManager.git
-
Installing packages
cd eManager && php composer install
-
Connecting database
// storing DB config in .env file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=ASTU DB_USERNAME=root DB_PASSWORD=
-
Running
php artisan serve
base-url : http://localhost:8000/api
Endpoint | Request Type | Body/Params | Response | Route |
---|---|---|---|---|
Register | POST | Body : { fname, lname, email, phonenumber, password } | { user, token } | /signup |
Login | POST | Body : { email, password } | { user, token } | /login |
EditProfile | PUT | Param: { id } Body : { fname, lname, email, phonenumber, password } | { user } | /edit_profile/{id} |
UploadProfile | POST | Body : { title, image, user_id } | { image } | /images/upload |
GetProfileByUserId | GET | Param: { id } | [ img_url ] | /images/{id} |
DeleteProfile | DELETE | Param: { id } | True(1) or False(0) | /delete_profile/{id} |
AddEmployee | POST | Body : { fname, lname, email, phonenumber, password, salary } | { employee } | /add |
GetEmployees | GET | { employee[] } | /employees | |
GetEmployeeById | GET | Param: { id } | { employee } | /employee/{id} |
GetEmployeeByEmail | GET | Param: { email } | { employee } | /employee/email/{email} |
Search | GET | Param: { text, limit?, offset? } | { employee[] } | /search/{text}?limit&offset |
EditEmployee | PUT | Param: { id } Body : { fname, lname, email, phonenumber, salary } | { employee } | /edit/{id} |
RemoveEmployee | DELETE | Param: { id } | True(1) or False(0) | /remove/{id} |
{
id: "user id",
fname: "first name",
lname: "last name",
email: "email",
phonenumber: "phone number",
created_at: "timestamp for new user",
updated_at: "timestamp for last uppdate of user"
}
{
id: "user id",
fname: "first name",
lname: "last name",
email: "email",
salary: "salary",
phonenumber: "phone number",
created_at: "timestamp for new employee",
updated_at: "timestamp for last uppdate of employee"
}
{
title: "title of the image",
img_path: "file path in disk",
user_id: "uploader id",
created_at: "timestamp for new image",
updated_at: "timestamp for last uppdate of image"
}