Skip to content
Marco E edited this page Sep 7, 2020 · 21 revisions

Welcome to the meeting-API wiki!

Here I will explain how to build a simple API for meeting purposes with Laravel 7 on windows 10 using Homestead. This project is based on the pluralsight course RESTful web services with PHP and Laravel by Maximilian Schwarzmüller.

Index

  1. Setup the project
  2. Connecting to database
  3. Add controllers
  4. Add routes
  5. Add models and migration files
  6. Add relations
  7. Add mass assignment for Meeting model
  8. Requests and responses
  9. Stateless authentication
  10. Authentication with Sanctum
  11. Test the API

Note: to enable cors you will need to add a third party package. Take a look at the question in Stackoverflow.

Meeting Scheduler API

The idea of this project, is to design and structure a RESTful service where users can create, update, and delete meetings. Users should be able to register and unregister for any created meetings. Finally, it should be possible to retrieve a list of all meetings and info about an individual meeting.

Meeting Scheduler: Requests & Responses

  • To implement this functionnalities, we will need the following actions:
Authentication required No authentication required
Create Meeting (POST) to /api/v1/meeting: Create User (POST) to /api/v1/user:
- Receive: Title, Description, Time, User ID - Receive: First name, Last name, e-mail, password
- Send: Message, Summary, Meeting URL, Participants - Send: Message, Summary
Update Meeting (PATCH) to /api/v1/meeting: Get List of all Meetings (GET) to /api/v1/meeting:
- Receive: Title, Description, Time Meeting ID, User ID - Receive: (no data)
- Send: Message, Summary, Meeting URL, Participants - Send: Meetings info, Links to individual Meetings
Delete Meeting (DELETE) to /api/v1/meeting: Get Data about individual Meeting (GET) to /api/v1/meeting:
- Receive: Meeting ID, User ID - Receive: Meeting ID
- Send: Message - Send: Meeting info, Link to list of meetings
Register for Meeting (POST) to /api/v1/meeting/registration: User signin (POST) to /api/v1/user/signin:
- Receive: User ID, Meeting ID - Receive: e-mail, password
- Send: Message, User info, Meeting info, Unregistration link - Send: token (Sanctum)
Unregister from Meeting (DELETE) to /api/v1/meeting/registration:
- Receive: User ID, Meeting ID
- Send: Message, User info, Meeting info, Registration link

PhpStorm (optional)

Before you start working with Laravel, make sure that either the Laravel (free) or Laravel Idea (paid) plugins are installed and enabled. Both plugins additionally require installing the Laravel IDE helper tool. For more info, see Laravel - Help | PhpStorm.

Clone this wiki locally