Skip to content

Evaristo-Paulo/api-training-center

Repository files navigation

Overview

Training center is an API that users can access to consume and provide services such as:

  • Courses
  • Trainers.
  • Trainees.
  • Managers (secretaries) - Authorized people who can have access to manage all critical information.

Getting started

You need to run seed, so you can have access to admin user

Command: php artisan migrate:fresh --seed

Authentication

Although you can have access of some services without authentication, most of the services you need to be authenticated firstly.

{ "email": "[email protected]", "password": "example" }

  • Response

{ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9hcGktdHJhaW5pbmctY2VudGVyLnRlc3RcL2FwaVwvYXV0aFwvbG9naW4iLCJpYXQiOjE2MzQ2MzU2MTEsImV4cCI6MTYzNDcyMjAxMSwibmJmIjoxNjM0NjM1NjExLCJqdGkiOiJOZjN6VlR3emR6cWxWNFhRIiwic3ViIjoxLCJwcnYiOiI4N2UwYWYxZWY5ZmQxNTgxMmZkZWM5NzE1M2ExNGUwYjA0NzU0NmFhIn0.9ay0xZkLIowfb1uW3pio8q2GOch1Bn82g74_JkMr7Yg", "token_type": "bearer", "token_validity": 86400 }

  • token: Token you need to pass in all request that needs authetication
  • token_type: type of the token
  • token_validity: How long this token is valid. Default value is 1 day

Resourses

All endpoints you need to know to start using training center API

  • Endpoint: http://localhost::8000/api/courses/store
  • Method: POST
  • Request { "name": "JAVA", "date_begin": "2021/10/19", "date_end": "2021/10/30", "price": 12000, "description": "Curso de JAVA" }
  • Store new course

  • Endpoint: http://localhost::8000/api/courses/1/update
  • Method: PUT
  • Request { "name": "JAVA WEB", "date_begin": "2021/10/19", "date_end": "2021/10/30", "price": 12000, "description": "Curso de JAVA WEB" }
  • Update data from course with id = 1

DATA

Here you can find some info about data and its value

  • Course
  • name: Course name (required)
  • date_begin: date to begin this course (required) (YYYY/MM/DD)
  • date_end: date to end this course (required) (YYYY/MM/DD)
  • price: cost (required)
  • Description: Some info about this course (optional)

  • Trainer
  • name: Trainer full name (required)
  • email: email (required)
  • phone: phone (required)
  • bi: Identity Document (required)
  • address: address (required)
  • gender: gender id (required)
  • courses: course id (it can be array of courses id) (required)

  • Trainee
  • name: Trainee full name (required)
  • email: email (required)
  • phone: phone (required)
  • bi: Identity Document (required)
  • address: address (required)
  • gender: gender id (required)
  • courses: course id (it can be array of courses id) (required)

About

Training Center API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published