Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 29 lines (22 sloc) 0.682 kB
d8eacf3 @tristandunn Add a Beer and Brewery class, clean up Request, use a namespace and o…
tristandunn authored
1 <?php
2
3 require_once "./phuggles/phuggles.php";
4
5 // Configuration options.
6 Phuggles\Configuration::$host = "http://api.localhost:3000/v1/";
7 Phuggles\Configuration::$public_token = "YOUR_PUBLIC_TOKEN";
8 Phuggles\Configuration::$private_token = "YOUR_PRIVATE_TOKEN";
9
10 // Get all beers.
11 print_r(Phuggles\Beer::all());
12
13 // Get a beer by ID.
14 print_r(Phuggles\Beer::get(1));
15
16 // Create a beer.
17 $parameters = array(
18 'brewery_id' => 1,
19 'beer' => array(
20 'name' => 'testing',
21 'description' => 'awesome',
22 'abv' => 6.4
23 )
24 );
25 print_r(Phuggles\Beer::create($parameters));
26
27 // Delete a beer by ID.
28 print_r(Phuggles\Beer::delete(7));
Something went wrong with that request. Please try again.