Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, queueing, and caching.
This app will allow a user to create a Pizza with a name, a description, and toppings.
composer install
then :
php artisan install
This will do the following:
- Generate a secret key.
- Creates a sqlite database inside "database" dir.
- Runs migrations.
composer test
This client covers these stories:
- As a builder, I should be able to list existing Pizzas
- As a builder, I should be able to create a new Pizza
- As a builder, I should be able to list the toppings I can to add to a Pizza
- As a builder, I should be able to add a topping to a pizza
- As a builder, I should be able to list toppings on a pizza
- As a builder, I should be able to create toppings that can be added to a Pizza
Use these resources to build your client. The server with these resources can be accessed at http://pizza.mehany.io/
GET toppings # List toppings
POST toppings # Create a topping
GET pizzas # List pizzas
POST pizzas # Create a pizza
GET pizzas/:id/toppings # List toppings associated with a pizza
POST pizzas/:id/toppings # Add a topping to an existing pizza
you can also prefix routes with api/
Example curl command to create a pizza:
curl -H "Content-Type: application/json" -H "Accept: application/json" https://pizza.mehany.io/pizzas --data '{"pizza": {"name": "belleboche", "description": "Pepperoni, Sausage, Mushroom"}}'
A Pizza is a baked, round piece of dough covered with sauce and toppings
POST /pizzas, {"pizza" => {"name" => "Belleboche", "description" => "Pepperoni, Mushroom and Sausage"}}
GET /pizzas
Raw ingredients that can be added to a pizza
POST /toppings, {topping: {name: "Pepperoni"}}
GET /toppings
Pizza Toppings are Toppings that have been added to a Pizza
POST /pizzas/:pizza_id/toppings, {topping_id: 1}
GET /pizzas/:pizza_id/toppings