Small Restaurant is a Laravel-based web application that allows users to place orders for burgers only for now.
To install Burger Restaurant, follow these steps:
-
Clone the repository:
git clone https://github.com/MarwanMohamed/burger-restaurant.git
-
Change to the project directory:
cd burger-restaurant
-
Copy the
.env.example
file to.env
:cp .env.example .env
-
Configure the
.env
file by adding your database credentials and merchant email. -
Install the required dependencies using Composer:
composer install
-
Run the database migrations:
php artisan migrate
-
Import products from a CSV file located in
public/Products.csv
. Move it to storage firstmv public/Products.csv storage/app/public php artisan add-products
- you also can use the seed command to seed products to the database:
- php artisan migrate
-
Generate an application key:
php artisan key:generate
-
Start the Laravel development server:
php artisan serve
-
To place an order, send a POST request to
http://127.0.0.1:8000/api/orders
with the following JSON payload:
{
"products": [
{
"product_id": 1,
"quantity": 2
}
]
}
To run the tests for this application, use the following command:
- php artisan test