本文整理汇总了PHP中app\Item::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::lists方法的具体用法?PHP Item::lists怎么用?PHP Item::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Item
的用法示例。
在下文中一共展示了Item::lists方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($id)
{
$activity = Activity::find($id);
$cars = Car::lists('name', 'id');
$customers = Customer::lists('name', 'id');
$locations = Location::lists('name', 'id');
$costs = null;
$items = null;
$ondayOtherCosts = null;
if ($activity->type == "On Day") {
$data = Onday::where('activity_id', '=', $id)->get()->pop();
$ondayOtherCosts = OndayOtherCost::where('onday_id', $data->id)->get();
} else {
if ($activity->type == "Maintenance") {
$data = Maintenance::where('activity_id', '=', $id)->get()->pop();
$costs = $activity->maintenance->items;
$items = Item::lists('name', 'id')->sort();
} else {
if ($activity->type == "Nil") {
$data = Nil::where('activity_id', '=', $id)->get()->pop();
}
}
}
return view('activity.edit', ['activity' => $activity, 'data' => $data, 'cars' => $cars, 'customers' => $customers, 'locations' => $locations, 'costs' => $costs, 'items' => $items, 'ondayOtherCosts' => $ondayOtherCosts]);
}
示例2: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$price = Account::whereMonth('accountdate', '=', date('m'))->where('user_id', Auth::user()->id)->sum('amount');
$items = Item::lists('item', 'item');
$itemname = Item::all();
$accounts = Account::where('user_id', Auth::user()->id)->orderBy('accountdate', 'desc')->paginate(10);
return view('accounts.index', ['accounts' => $accounts, 'items' => $items, 'itemname' => $itemname, 'price' => $price]);
}
示例3: edit
public function edit($id)
{
$price_log = PriceLog::find($id);
$supplierOptions = Supplier::lists('name', 'id');
$itemOptions = Item::lists('name', 'id');
$availability = ['1' => 'Yes', '0' => 'No'];
$date = $price_log->date;
return view('price_logs.edit', compact('date', 'availability', 'price_log', 'supplierOptions', 'itemOptions'));
}
示例4: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
$reportOptions = [];
$reportOptions['sales'] = 'Sales';
$reportOptions['collection'] = 'Collection';
$reportOptions['item'] = 'Item';
$reportOptions['client'] = 'Client';
$clients = Client::lists('name', 'id');
$items = Item::lists('name', 'id');
//$yearOptions = [];
//$counter = 0;
//$years = DB::select("SELECT YEAR(date) AS 'year' FROM sales_invoices")->get();
$years = DB::table('sales_invoices')->select(db::raw('YEAR(date) as yearDate'))->lists('yearDate', 'yearDate');
//$years = Salesinvoice::lists('date');
return view('reports.index', compact('reportOptions', 'clients', 'items', 'years'));
//return $years;
}
示例5: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$estimate = Estimate::findOrFail($id);
$vehicles = Vehicle::lists('reg_no', 'id')->all();
$customer_list = Customer::lists('name', 'id')->all();
$departments = Department::lists('name', 'id');
$items = Item::lists('name', 'id')->all();
$estimate_details = DB::table('estimate_details')->where('estimate_id', '=', $id)->get();
return view('estimates.edit', compact('estimate', 'vehicles', 'estimate_details', 'customer_list', 'departments', 'items'));
}
示例6: create
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$suppliers = Supplier::lists('name', 'id')->all();
$items = Item::lists('name', 'id')->all();
return view('orders.create', compact('suppliers', 'items'));
}
示例7: processMaintenanceFormView
public function processMaintenanceFormView()
{
$activity = Session::get('activity');
$items = Item::lists('name', 'id')->sort();
$old_maintenance = Session::get('maintenance');
if ($old_maintenance == null) {
$maintenance = new Maintenance();
$maintenance->activity_id = $activity->id;
$maintenance->save();
Session::put('maintenance', $maintenance);
} else {
$maintenance = $old_maintenance;
}
$costs = Maintenance::find($maintenance->id)->items;
$activities = Activity::orderBy('created_at', 'desc')->take(10)->get();
return view('home', ['type' => '2', 'activity' => $activity, 'activities' => $activities, 'items' => $items, 'maintenance_id' => $maintenance->id, 'costs' => $costs]);
// Session::forget('activity');
// return view('home', [ 'type'=> '2', 'activity' => $activity, 'activities' => $activities]);
}
示例8: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$image = Image::whereId($id)->firstOrFail();
$items = Item::lists('name', 'id');
return view('images.edit', compact('image', 'items'));
}