本文整理汇总了PHP中app\Client::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::lists方法的具体用法?PHP Client::lists怎么用?PHP Client::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Client
的用法示例。
在下文中一共展示了Client::lists方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
if (Gate::denies('addClient', new Client())) {
abort(403, 'You are now allowed here');
}
$client = Client::lists('name', 'id');
return view('project.create')->with('client', $client);
}
示例2: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return Response
*/
public function edit($id)
{
$facture = Facture::findOrFail($id);
/*Lists*/
$projects = Project::lists('name', 'id');
$selectedProjects = $facture->projects->lists('id')->flatten()->all();
$contacts = Contact::select('id', DB::raw('CONCAT(first_name, " ", last_name) as full_name'))->orderBy('last_name', 'asc')->lists('full_name', 'id');
$clients = Client::lists('email', 'id');
//dd($selectedProjects);
return view('admin.facture.edit', compact('facture', 'projects', 'selectedProjects', 'contacts', 'clients'));
}
示例3: 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;
}
示例4: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$clients = Client::lists('name', 'id');
return view('testView', compact('clients'));
}
示例5: edit
/**
* Show the form for editing the specified resource.
*
* @param Project $project
* @return Response
*/
public function edit(Project $project)
{
$clients = Client::lists('name', 'id');
return view('projects.edit', compact('clients', 'project'));
}
示例6: edit
public function edit(Client $client)
{
$clients = Client::lists('first_name', 'id');
return view('clients.edit', compact('client', 'clients'));
}