public function run()
 {
     $product = Product::create(['name' => 'Bacon Baby!', 'price' => '10.00', 'image' => 'http://baconmockup.com/200/200', 'in_stock' => true, 'description' => 'A bacon hat!']);
     $product = Product::create(['name' => 'Bacon Baby!', 'price' => '20.00', 'image' => 'http://baconmockup.com/200/200', 'in_stock' => true, 'description' => 'A bacon hat!']);
     $product = Product::create(['name' => 'Bacon Baby!', 'price' => '30.00', 'image' => 'http://baconmockup.com/200/200', 'in_stock' => true, 'description' => 'A bacon hat!']);
     $product = Product::create(['name' => 'Bacon Baby!', 'price' => '40.00', 'image' => 'http://baconmockup.com/200/200', 'in_stock' => true, 'description' => 'A bacon hat!']);
     $product = Product::create(['name' => 'Bacon Baby!', 'price' => '50.00', 'image' => 'http://baconmockup.com/200/200', 'in_stock' => true, 'description' => 'A bacon hat!']);
     $product = Product::create(['name' => 'Bacon Baby!', 'price' => '60.00', 'image' => 'http://baconmockup.com/200/200', 'in_stock' => true, 'description' => 'A bacon hat!']);
 }
Ejemplo n.º 2
0
 public function boot()
 {
     require 'vendor/autoload.php';
     Stripe\Stripe::setApiKey(Settings::instance()->api_key);
     if (Input::has('stripeToken') && Input::has('product_id')) {
         $product = Product::find(Input::get('product_id'));
         try {
             $charge = \Stripe\Charge::create(array("amount" => preg_replace('/[.]/', '', $product->price), "currency" => "usd", "source" => Input::get('stripeToken'), "description" => "*****@*****.**"));
         } catch (\Stripe\Error\Card $e) {
             // The card has been declined
         }
     }
 }
Ejemplo n.º 3
0
 public function products()
 {
     return Product::all();
 }
Ejemplo n.º 4
0
 public function product()
 {
     return ProdModel::find(Input::get('buy-item-id'));
 }