本文整理匯總了PHP中app\models\Item::lists方法的典型用法代碼示例。如果您正苦於以下問題:PHP Item::lists方法的具體用法?PHP Item::lists怎麽用?PHP Item::lists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\Item
的用法示例。
在下文中一共展示了Item::lists方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: edit
/**
* 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);
}
示例2: fire
/**
* 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');
}