The api for the turft.nl website
-
Clone .git directory
-
Run
composer install -
Initialize laravel project:
- Copy
.env.exampleto.env:cp .env.example .env - Run
php artisan key:generate - Run
php artisan app:name App
- Copy
-
Run ide helper
- Run
php artisan ide-helper:generate - Run
php artisan ide-helper:meta(for phpstorm)
- Run
-
Build the database
- Run
php artisan migrate
- Run
-
Start the API
- Run
php artisan serve --host 0.0.0.0 --port 8000
- Run
You can now go to the API through localhost:8000
- GET '/'
- The index retrieving all groups
- POST '/'
- Save a group with fields:
- Name: String(50), UNIQUE
- Save a group with fields:
- GET '/group/{groupId}'
- Get a specific group
- PUT '/group/{groupId}'
- Update a specific group with fields:
- Name: String(50), UNIQUE
- Update a specific group with fields:
- DELETE '/group/{groupId}'
- Delete a specific group
- POST '/group/{group}/addUser'
- Add a user to a group with specified role
- user: Integer(11), Unsigned
- role: Enum("owner", "admin", "member")
- Add a user to a group with specified role
- POST '/oauth/token'
- Retrieve a token based on credentials:
- username: String(50)
- password: String(50)
- Retrieve a token based on credentials:
- POST '/register'
- Register a new user
- email: String(50)
- name: String(50)
- password: String(50)
- Register a new user