Skip to content

A company has multiple departments and each employee works in one of the departments. Each employee may have multiple contact numbers and addresses.

Notifications You must be signed in to change notification settings

shashihawanna/aertrip_employee

Repository files navigation

About Project

company has multiple departments and each employee works in one of the departments. Each employee may have multiple contact numbers and addresses:

How To Run

  1. Clone the repo and run below command:-
    composer install

  2. Add database details in .env file create .env from .env.example

  3. Run migration to create database tables:-
    php artisan migrate

  4. Run Passport install for personal access client:-
    php artisan passport:install

  5. Run api endpoints in api client and run server:-
    php artisan serve

  6. First register and login the user then auth token will get generate
    end points for registration and login

    1. api/register
      Parameters:-
      name: text
      email: text email
      password: text or number
      password_confirmation: sam as password
      Then auth token got genarated use to run department and employee api

    1. api/login
      Parameters:-
      email: text email
      password: text or number
      Then auth token got genarated use to run department and employee api
  7. Below are the end points for department and employee
    First Create departments:-

    1. POST api/department => create department
      Header Parameters:-
      Authorization: Bearer token
      Form Parameters:-
      dep_name: text

    1. GET api/department => get all department
      Header Parameters:-
      Authorization: Bearer token

    2. GET api/department/id => get department by id
      Header Parameters:-
      Authorization: Bearer token


    1. PUT api/department/id => Update department by id
      Header Parameters:-
      Authorization: Bearer token
      Form Parameters:-
      dep_name: text

    1. DELETE api/department/id => Delete department by id
      Header Parameters:-
      Authorization: Bearer token

    Employee api endpoints:-

    1. POST api/employee => create employee
      Header Parameters:-
      Authorization: Bearer token
      Form Parameters:-
      name: text
      age: text
      job: text
      salary: number
      dep_id: text
      contacts: number (or pass as array like contacts[0],contacts[1],... for multiple contact creation )
      address: text (or pass as array like address[0],address[1],... for multiple address creation)

    1. GET api/employee => get all employee's with associated contacts and address
      Header Parameters:-
      Authorization: Bearer token

    2. GET api/employee/id => get employee details by id with associated contacts and addresss
      Header Parameters:-
      Authorization: Bearer token


    1. PUT api/employee/id => Update employee by id
      Header Parameters:-
      Authorization: Bearer token
      Form Parameters:-
      name: text
      age: text
      job: text
      salary: number
      dep_id: text
      contacts: number (or pass as array like contacts[0],contacts[1],... for multiple contact creation )
      address: text (or pass as array like address[0],address[1],... for multiple address creation )

    1. DELETE api/employee/id => Delete employee by id
      Header Parameters:-
      Authorization: Bearer token

    1. GET api/search-employee => Search employee by name
      Header Parameters:-
      Authorization: Bearer token
      Query Parameters:-
      name: text

About

A company has multiple departments and each employee works in one of the departments. Each employee may have multiple contact numbers and addresses.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published