URL: /api/orders
HTTP Method: POST
Controller Action: OrderController@create
Description: This route allows a customer to create a new order by sending a POST request with the order details.
List a Customer's Orders:
List a Customer's Orders:
URL: /api/customers/{customer_id}/orders
HTTP Method: GET
Controller Action: OrderController@index
Description: Retrieve a list of orders for a specific customer.
View Order Details:
View Order Details:
URL: /api/orders/{order_id}
HTTP Method: GET
Controller Action: OrderController@show
Description: Retrieve details of a specific order, including its progress and associated products.
Update Order Status:
Update Order Status:
URL: /api/orders/{order_id}
HTTP Method: PUT or PATCH
Controller Action: OrderController@update
Description: Update the status of a specific order (e.g., from "Processing" to "Shipped").
Delete an Order:
Delete an Order:
URL: /api/orders/{order_id}
HTTP Method: DELETE
Controller Action: OrderController@destroy
Description: Allow customers to cancel an order.
Add Product to Order:
Add Product to Order:
URL: /api/orders/{order_id}/products
HTTP Method: POST
Controller Action: OrderDetailController@store
Description: Add a product to an existing order.
Remove Product from Order:
Remove Product from Order:
URL: /api/orders/{order_id}/products/{product_id}
HTTP Method: DELETE
Controller Action: OrderDetailController@destroy
Description: Remove a product from an order.
List Products:
List Products:
URL: /api/products
HTTP Method: GET
Controller Action: ProductController@index
Description: Retrieve a list of available products.
Create an Order:
URL: /api/orders HTTP Method: POST Controller Action: OrderController@create Description: This route allows a customer to create a new order by sending a POST request with the order details. List a Customer's Orders:
List a Customer's Orders:
URL: /api/customers/{customer_id}/orders HTTP Method: GET Controller Action: OrderController@index Description: Retrieve a list of orders for a specific customer. View Order Details:
View Order Details:
URL: /api/orders/{order_id} HTTP Method: GET Controller Action: OrderController@show Description: Retrieve details of a specific order, including its progress and associated products. Update Order Status:
Update Order Status:
URL: /api/orders/{order_id} HTTP Method: PUT or PATCH Controller Action: OrderController@update Description: Update the status of a specific order (e.g., from "Processing" to "Shipped"). Delete an Order:
Delete an Order:
URL: /api/orders/{order_id} HTTP Method: DELETE Controller Action: OrderController@destroy Description: Allow customers to cancel an order. Add Product to Order:
Add Product to Order:
URL: /api/orders/{order_id}/products HTTP Method: POST Controller Action: OrderDetailController@store Description: Add a product to an existing order. Remove Product from Order:
Remove Product from Order:
URL: /api/orders/{order_id}/products/{product_id} HTTP Method: DELETE Controller Action: OrderDetailController@destroy Description: Remove a product from an order. List Products:
List Products:
URL: /api/products HTTP Method: GET Controller Action: ProductController@index Description: Retrieve a list of available products.