This is the backend of the restaurant menu.
Please Note that I did NOT cover the cases that aren't mentioned in the requirements (such as update/delete items) file since the purpose of the project is to showcase the code structure and not to release a project. However, all requirements that are mentioned in the file are covered here. To get started quickly I used Laravel Breeze (API) to scaffold the project and focus on what matters.
Method | Url | Description |
---|---|---|
GET | api/user |
Get currently authenticated user |
POST | api/v1/categories |
Store category |
GET | api/v1/categories/{category}/menu-items |
Get menu Items of a category |
POST | api/v1/discount/category/{category} |
Add discount to a category |
POST | api/v1/discount/global |
Add global discount |
POST | api/v1/discount/menu-item/{menuItem} |
Add discount to menu item |
POST | api/v1/menu-items |
Add menu item |
GET | api/v1/{user}/categories |
Get categories of a user |
GET | api/v1/{user}/categories/can-have-child-category |
Get items for category selector (in category create) |
GET | api/v1/{user}/categories/can-have-menu-items |
Get items for category selector (in menu item create) |
- Clone this repo
composer install
cp .env.example .env
php artisan key:generate
- update the
DATABASE
values in.env
php artisan migrate --seed --seeder=DemoSeeder
php artisan serve
password | |
---|---|
user@gmail.com | password |
In this project, every single api is tested with the required tests that insures that it's working as it's intended to do especially the ones mentioned in the requirements file
To run the tests use this command
php artisan test
This project is open-sourced software licensed under the MIT license.