本文整理匯總了PHP中app\Company::lists方法的典型用法代碼示例。如果您正苦於以下問題:PHP Company::lists方法的具體用法?PHP Company::lists怎麽用?PHP Company::lists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Company
的用法示例。
在下文中一共展示了Company::lists方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getEdit
public function getEdit($id)
{
$company = Company::find($id);
$companies = Company::lists('name', 'id');
$clients_selected = $company->clients()->getRelatedIds()->all();
$providers_selected = $company->providers()->getRelatedIds()->all();
$data = array('company' => $company, 'companies' => $companies, 'clients_selected' => $clients_selected, 'providers_selected' => $providers_selected);
return view('admin.company.edit', $data);
}
示例2: edit
public function edit($id)
{
$pl_data = \App\PerangkatLunak::find($id);
$medias = \App\Media::lists('nama_media', 'id');
$licenses = \App\License::lists('nama_license', 'id');
$jenises = \App\Jenis::lists('nama_jenis', 'id');
$companies = \App\Company::lists('nama_company', 'id');
return view('perangkat_lunak.edit', ['pl_data' => $pl_data, 'medias' => $medias, 'licenses' => $licenses, 'jenises' => $jenises, 'companies' => $companies]);
}
示例3: showMovimientosPorUsuario
public function showMovimientosPorUsuario()
{
$companies = Company::lists('name', 'id');
// Traigo todos los almacenes que pertenecen a la compañía del usuario
$arrayW = collect(DB::table('warehouses')->select('id')->where('company_id', Auth::user()->current_company_id)->get());
// Traigo todos los usuarios que no han sido borrados, y que pertenecen a la empresa seleccionada por el usuario
// para precargar el dropdown
$users = DB::table('users')->select(DB::raw('concat(firstName, " ", lastName) as name, id'))->whereNull('deleted_at')->where('company_id', Auth::user()->current_company_id)->lists('name', 'id');
return view('reports.movimientosPorUsuarioForm', compact('companies', 'users'));
}
示例4: getSelectList
public function getSelectList()
{
$companies = ['0' => '-- None'];
return array_merge($companies, Company::lists('name', 'id')->toArray());
}