本文整理汇总了PHP中app\Activity::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Activity::lists方法的具体用法?PHP Activity::lists怎么用?PHP Activity::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Activity
的用法示例。
在下文中一共展示了Activity::lists方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$warehouse = Warehouse::findOrFail($id);
$activities = Activity::lists('name', 'id');
$types = Type::lists('name', 'id');
return view('warehouses.edit', compact('warehouse', 'activities', 'types'));
}
示例2: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
if (Auth::check()) {
# code...
if (Auth::user()->type == 1) {
# code...
$event = Event::findOrFail($id);
$activities = Activity::lists('activity_name', 'id');
return view('events.editEvent', compact('event', 'activities'));
}
return redirect('/');
}
return redirect('/');
}
示例3: edit
public function edit($id)
{
$company = Company::findOrFail($id);
$activities = Activity::lists('name', 'id');
return view('companies.edit', compact('company', 'activities'));
}
示例4: lists
public function lists($value, $key = '')
{
return \App\Activity::lists($value, $key);
}
示例5: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$user = User::findOrFail($id);
$activities = Activity::lists('name', 'id');
/* $warehouses = Warehouse::where('company_id', Auth::user()->current_company_id)->
get()->
lists('name', 'id');*/
// $warehouses = Warehouse::where('company_id', Auth::user()->current_company_id)->
// get()->
// lists('name', 'id');
if (Auth::user()->currentCompany->parent == 1) {
$warehouses = Warehouse::lists('name', 'id');
} else {
$warehouses = Warehouse::where('company_id', Auth::user()->current_company_id)->get()->lists('name', 'id');
}
$securityLevel = ['10' => 'Técnico', '20' => 'Supervisor', '30' => 'Jefe', '40' => 'Gerente', '50' => 'Director'];
return view('users.edit', compact('user', 'activities', 'warehouses', 'securityLevel'));
}