Example #1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $request = Topup::find($id);
     $items = Item::lists('name', 'id');
     $item = $request->item_id;
     $testCategories = TestCategory::lists('name', 'id');
     $testCategory = $request->test_category_id;
     return view('inventory.request.edit')->with('testCategories', $testCategories)->with('items', $items)->with('item', $item)->with('request', $request)->with('testCategory', $testCategory);
 }
Example #2
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $api = new ItemAPI();
     // Get the list of all available items and see which
     // ones are not in the database yet
     $available_ids = $api->getList();
     $existing_ids = Item::lists('id');
     $new_ids = array_diff($available_ids, $existing_ids);
     $this->info('Found ' . count($new_ids) . ' new items');
     // For each new item, add a queue to grab the detail stuff
     foreach ($new_ids as $id) {
         Queue::push(new UpdateItemDetails($id));
     }
     $this->info('Done adding queue entries');
 }