Overview
TheOrder model represents customer orders in the restaurant management system. It stores order details including food items, quantities, pricing, and customer delivery information.
Table Information
Table Name:
ordersModel Definition
Fillable Fields
Name of the food item ordered
- Database Type:
string - Nullable: Yes
- Example: “Grilled Salmon Deluxe”
Quantity of items ordered
- Database Type:
string - Nullable: Yes
- Example: “2”
Total price for the order
- Database Type:
string - Nullable: Yes
- Example: “51.98”
Customer name for the order
- Database Type:
string - Nullable: Yes
- Example: “John Doe”
Customer phone number
- Database Type:
string - Nullable: Yes
- Example: “+1-555-0123”
Delivery address for the order
- Database Type:
string - Nullable: Yes
- Example: “123 Main St, Apt 4B, New York, NY 10001”
Relationships
Database Schema
Usage Example
Timestamps
created_at: Automatically set when the order is createdupdated_at: Automatically updated when the order is modified
Notes
The current implementation stores price and quantity as strings. Consider migrating these fields to appropriate numeric types (decimal for price, integer for quantity) for better data integrity and calculation support.