本文整理匯總了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'));
}