- This project is about ordering food . I have used api Laravel.
- The user has to register by giving his details - Name ,Phone number and Location. These are stored inside database in "users" table.
- The Food items are stored in table "Food". It has food_id,food_name and price fields.
- The Orders user placed are stored in "orders" table. Ih has the order_id,user_name,food_name,quantity,price and amount fields.
-
$ php artisan make:model user
-
$ php artisan make:model orders
-
$ php artisan make:model food
-
All controllers has crud.
-
Here is Routes URL with Verb of User Controller:
-get http://127.0.0.1:8000/Users
-get http://127.0.0.1:8000/Users/2
-post http://127.0.0.1:8000/Users - [user_name - geeta] [Phone - 9908767621] [location - kr street mysore]
-patch http://127.0.0.1:8000/Users/2
-delete http://127.0.0.1:8000/Users/2
-get http://127.0.0.1:8000/orders
-get http://127.0.0.1:8000/orders/2
To insert order details pass user_name,food_name, quantity,price .Userid is auto generated and amount is calculated by quantity and price of food ordered.
-post http://127.0.0.1:8000/orders - [user_id - 2] [food_name - Dosa] [quantity - 3]
-patch http://127.0.0.1:8000/orders/2
-delete http://127.0.0.1:8000/orders/2
-get http://127.0.0.1:8000/food
-get http://127.0.0.1:8000/food/2
-post http://127.0.0.1:8000/food - [food_name - Dosa] [price - 50.00]
-patch http://127.0.0.1:8000/food/2
-delete http://127.0.0.1:8000/food/2