Backend of simple ticketing system made with Laravel, built for Loket Backend Code Assignment. Built with TDD approach.
- Clone this repository with git command on your working directory:
git clone https://github.com/faldyif/loket-backend.git
- Edit the .env.example file. Change the DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD parameter as your database configuration.
- Save the file as .env
- Install the dependencies:
composer install --no-scripts
- Generate a random key with artisan command
php artisan key:generate
- Migrate the tables to database
php artisan migrate
- For symlinking the storage folder for file uploads, use:
php artisan storage:link
$ php artisan serve
$ vendor/bin/phpunit
[POST] /location/create
Params:
name // required, between: 5-100 chars
city // required
address // required
latitude // required, latitude
longitude // required, longitude
[POST] /event/create
Params:
name // required, between: 5-100 chars
description // required, min: 10 chars
location_id // required, location id that has created before
start_at // required, date time
end_at // required, date time
[POST] /event/create
Params:
quota // required, between: 5-100 chars
price // required, min: 10 chars
name // required, min: 10 chars
event_id // required, location id that has created before
[GET] /event/get_info
[POST] /transaction/create
Params:
customer // required, array, consists of name, email, phone, and address
event_id // required, between: 5-100 chars
location_id // required, event id that has created before
ticket_types // required, array, consists of collection array that has ticket_type_id, and quantity
- Laravel 5.6 - The web framework used
- Composer - Dependency Management
- PHPUnit - Testing framework