本文整理汇总了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());
}