/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $dataname = ['bow', 'bowl', 'treatcontainer', 'blanket'];
     $datasize = ['small', 'medium', 'large', 'xlarge'];
     $datadescription = ['Beautiful black bows', 'Metallic bowl', 'Fillable treat container', 'Snuggly blanket'];
     $dataprice = ['10.00', '7.00', '5.99', '4.99'];
     $dataquantity = ['1', '2', '3', '4'];
     for ($i = 0; $i < count($dataname); ++$i) {
         $accesory = new \App\Accesory();
         $accesory->name = $dataname[$i];
         $accesory->size = $datasize[$i];
         $accesory->price = $dataprice[$i];
         $accesory->quantity = $dataquantity[$i];
         $accesory->order_total = $dataquantity[$i] * $dataprice[$i];
         $accesory->description = $datadescription[$i];
         $accesory->save();
     }
 }
Exemple #2
0
 /**
  * Responds to requests to GET /books/create
  */
 public function getCreate()
 {
     # Get all the possible accessories to display to the user
     $accesoryModel = new \App\Accesory();
     $accesories_for_checkbox = $accesoryModel->getAccesoriesForCheckboxes();
     $accesories_for_inputbox = $accesoryModel->getAccesoriesForInputboxes();
     $accesoryprices_for_display = $accesoryModel->getAccesoriesPrices();
     # Get all the possible treats to display to the user
     $treatModel = new \App\Treat();
     $treats_for_checkbox = $treatModel->getTreatsForCheckboxes();
     $treats_for_inputbox = $treatModel->getTreatsForInputboxes();
     $treatprices_for_display = $treatModel->getTreatsPrices();
     return view('orders.create')->with('treats_for_checkbox', $treats_for_checkbox)->with('treats_for_inputbox', $treats_for_inputbox)->with('accesories_for_checkbox', $accesories_for_checkbox)->with('accesories_for_inputbox', $accesories_for_inputbox)->with('accesoryprices_for_display', $accesoryprices_for_display)->with('treatprices_for_display', $treatprices_for_display);
 }