本文整理汇总了PHP中app\Group::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Group::lists方法的具体用法?PHP Group::lists怎么用?PHP Group::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Group
的用法示例。
在下文中一共展示了Group::lists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$faker = Faker\Factory::create();
$group = Group::lists('id')->all();
$level = Level::lists('id')->all();
for ($i = 0; $i < 20; $i++) {
$fellows = Fellow::create(array('level_id' => $faker->unique()->randomElement($level), 'group_id' => $faker->unique()->randomElement($group), 'name' => $faker->unique()->word));
}
}
示例2: edit
/**
* Show the form for editing the specified member.
*
* @param int $id The id of the member to edit
* @return Response
*/
public function edit($id)
{
$member = Member::findOrFail($id);
// Find member
$groups = Group::lists('name', 'id');
// Get list of all groups and their ids for the form
$districts = District::lists('name', 'id');
// Get list of all Districts
return view('members.edit', compact('member', 'groups', 'districts'));
}
示例3: run
public function run()
{
$faker = Faker\Factory::create();
$requests = [["title" => "Asciit code review", "details" => "Would you like to join to our review?"], ["title" => "Reviewr code review", "details" => "We have fixed almost all bugs after the last review. Just look at this miracle! It works!"], ["title" => "Calendar code review", "details" => "Ok, we prepared a few of the new features, but we need a piece of good advise."], ["title" => "User profile code review", "details" => "Hello! We're glad to invite you to our code review. We have done everything. Our code base is very stable."], ["title" => "News code review", "details" => "Hi! We invite you to take a look at our code. We improved an architecture."], ["title" => "Questionnaire code review", "details" => "Ok, we are ready to share our experience of TDD on our project. Feel free to join."], ["title" => "Hunter code review", "details" => "Hello! We're waiting fo your assessment. Would you like to join?"], ["title" => "Feedbacks code review", "details" => "Hello everybody! Can you estimate our new approach?"], ["title" => "Interview code review", "details" => "Hello! Please, help use to check the usability of our new interface."], ["title" => "Accounting code review", "details" => "Hi there! So, we are ready to describe and share our stable code base. Please, offer us an opinion about it."], ["title" => "Hunter code review", "details" => "Hi there! Please, take a look to result of our great work."], ["title" => "Reviewr", "details" => "Hello! Reviewr is ready for review."]];
$userIds = User::lists('id')->toArray();
$groupIds = Group::lists('id')->toArray();
foreach ($requests as $reviewRequest) {
ReviewRequest::create(['title' => $reviewRequest['title'], 'details' => $reviewRequest['details'], 'date_review' => $faker->dateTimeBetween('-1 days', '+15 days'), 'user_id' => $faker->randomElement($userIds), 'group_id' => $faker->randomElement($groupIds)]);
}
}
示例4: scraper
/**
* Show the application welcome screen to the user.
*
* @return Response
*/
public function scraper()
{
$success = '';
$groups = Group::lists('name', 'group_id');
$locations = Location::lists('location', 'location_id');
//$tournaments = Tournament::orderBy('start_date', 'desc')
// ->lists('name','tournament_id');
$tournaments = Tournament::selectRaw('CONCAT(name, " (", start_date, ")") as name, tournament_id')->orderBy('start_date', 'desc')->lists('name', 'tournament_id');
$players = Player::select('first_name', 'last_name', 'player_id', \DB::raw('CONCAT(first_name, " ", last_name) as full_name'))->orderBy('first_name')->orderBy('last_name')->get()->lists('full_name', 'player_id');
return view('admin.scraper', compact('groups', 'locations', 'tournaments', 'players', 'success'));
}
示例5: edit
public function edit($entity)
{
parent::edit($entity);
$this->edit = \DataEdit::source(new \App\Movement());
$this->edit->label('Movimeiento');
$this->edit->add('fecha', 'Fecha', 'date')->rule('required')->format('d/m/Y', 'es');
$this->edit->add('tipo', 'Tipo', 'radiogroup')->rule('required')->option('ingreso', 'Ingreso')->option('egreso', 'Egreso')->insertValue('egreso');
$this->edit->add('category_id', 'Categoría', 'select')->rule('required')->options(\App\Category::lists('nombre', 'id')->all());
$this->edit->add('person_id', 'Persona', 'select')->rule('required')->options(\App\People::lists('nombre', 'id')->all());
$this->edit->add('group_id', 'Grupo', 'select')->rule('required')->options(\App\Group::lists('nombre', 'id')->all());
$this->edit->add('monto', 'Monto ($)', 'text')->rule('required');
$this->edit->add('comprobante', 'Comprobante', 'file')->move('media/comprobantes/');
$this->edit->add('notas', 'Notas', 'textarea')->rule('required');
return $this->returnEditView();
}
示例6: cargaGasto
public function cargaGasto(Request $request)
{
debug($request->session()->get('user'));
if (!$request->session()->get('user')) {
return redirect('/auth/google');
}
$form = \DataEdit::source(new Movement());
$form->add('fecha', 'Fecha', 'date')->rule('required')->format('d/m/Y', 'es');
$form->add('tipo', 'Tipo', 'radiogroup')->rule('required')->option('ingreso', 'Ingreso')->option('egreso', 'Egreso')->insertValue('egreso');
$form->add('category_id', 'Categoría', 'select')->rule('required')->options(\App\Category::lists('nombre', 'id')->all());
$form->add('person_id', 'Persona', 'select')->rule('required')->options(\App\People::lists('nombre', 'id')->all());
$form->add('group_id', 'Grupo', 'select')->rule('required')->options(\App\Group::lists('nombre', 'id')->all());
$form->add('monto', 'Monto ($)', 'text')->rule('required');
$form->add('comprobante', 'Comprobante', 'file')->move('media/comprobantes/');
$form->add('notas', 'Notas', 'textarea')->rule('required');
$form->saved(function () use($form) {
$form->message("Gasto guardado");
$form->link("/cargar", "Ingresar otro");
});
return $form->view('gasto', compact('form'))->with('tab', 'gastos');
}
示例7: show
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
$employees = Employee::all();
$results = array();
foreach ($employees as $key => $value) {
if (count($value->user()->get()) == 0) {
$results += array($value->id => $value->lastname . " " . $value->firstname);
}
}
$emloyee_relation = User::find($id)->employee()->first();
$fullname = $emloyee_relation->lastname . " " . $emloyee_relation->firstname;
$user = User::find($id);
$resultchoose = User::find($id)->employee_id;
$results += array($resultchoose => $fullname);
$groups = Group::lists('groupname', 'id');
$groupssl = $user->group->lists('id');
if (is_null($user)) {
return redirect()->route('users.index');
}
return View('users.edituser', compact('user', 'groups', 'groupssl', 'results', 'resultchoose'));
}
示例8: editTaskFromComments
public function editTaskFromComments($id, Requests\EditTaskRequest $request)
{
$progress = ['0' => 'Not Started', '1' => 'In Progress', '2' => 'Done'];
$model = new Task();
$task = Task::findOrFail($id);
$groups = Group::lists('name', 'id');
$users = User::lists('name', 'id');
$bpid = $model->getBpIdFromTask($id);
$action = Action::find($task->action_id)->description;
$names = explode(', ', $task->collaborators);
$selectedUsers = array();
$selectedGroups = array();
foreach ($names as $name) {
if (count(User::all()->where('name', $name)) > 0) {
array_push($selectedUsers, User::all()->where('name', $name)->first()->id);
}
if (count(Group::all()->where('name', $name)) > 0) {
array_push($selectedGroups, Group::all()->where('name', $name)->first()->id);
}
}
return view('editTaskComments', compact('task', 'action', 'groups', 'users', 'bpid', 'selectedUsers', 'selectedGroups', 'progress'));
}
示例9: editActionFromComments
public function editActionFromComments($id, Requests\EditActionRequest $request)
{
$progress = ['0' => 'Not Started', '1' => 'In Progress', '2' => 'Done'];
$model = new Action();
$action = Action::findOrFail($id);
$bpid = $model->getBpIdFromAction($id);
$objective = Objective::find($action->objective_id)->name;
$groups = Group::lists('name', 'id');
$users = User::lists('name', 'id');
$names = explode(', ', $action->collaborators);
$selectedUsers = array();
$selectedGroups = array();
foreach ($names as $name) {
if (count(User::all()->where('name', $name)) > 0) {
array_push($selectedUsers, User::all()->where('name', $name)->first()->id);
}
if (count(Group::all()->where('name', $name)) > 0) {
array_push($selectedGroups, Group::all()->where('name', $name)->first()->id);
}
}
return view('editActionComments', compact('action', 'objective', 'groups', 'users', 'bpid', 'selectedUsers', 'selectedGroups', 'progress'));
}
示例10: foreach
<th class="text-center">Group</th>
<th style="width: 10%" class="last-child text-center">{{trans('messages.actions')}}</th>
</tr>
</thead>
<tbody>
<?php
foreach ($users as $user) {
$number++;
?>
<tr>
<td class="text-center">{{$number}}</td>
<td>{{ $user->username }}</td>
<td>{{ $user->fullname }}</td>
<?php
$groups = \App\Group::lists('groupname', 'id');
$groupssl = $user->group->lists('id');
?>
<td>
<?php
foreach ($groupssl as $key => $value) {
?>
<p class="grouptag"><?php
echo $groups[$value];
?>
</p>
<?php
}
?>
</td>
<td class="text-center">
示例11: editTask
public function editTask($idbp, $id)
{
$bp = BusinessPlan::findOrFail($idbp);
$task = Task::findOrFail($id);
$actions = Action::lists('description');
$user = User::lists('name');
$groups = Group::lists('name', 'id');
$users = User::lists('name', 'id');
$names = explode(', ', $task->collaborators);
$selectedUsers = array();
$selectedGroups = array();
foreach ($names as $name) {
if (count(User::all()->where('name', $name)) > 0) {
array_push($selectedUsers, User::all()->where('name', $name)->first()->id);
}
if (count(Group::all()->where('name', $name)) > 0) {
array_push($selectedGroups, Group::all()->where('name', $name)->first()->id);
}
}
$progress = ['0' => 'Not Started', '1' => 'In Progress', '2' => 'Done'];
return view('businessPlan.editTask', compact('task', 'actions', 'groups', 'user', 'idbp', 'users', 'selectedUsers', 'selectedGroups', 'progress'));
}
示例12: edit
public function edit($id)
{
$groups = Group::lists("name", "id");
$user = User::findOrFail($id);
return view('users.edit', compact('user', 'groups'));
}
示例13: run
/**
*
*/
public function run()
{
$faker = Faker::create();
$folderIds = Folder::lists('id');
$groupIds = Group::lists('id');
foreach (range(1, 200) as $index) {
Event::create(['title' => $faker->word, 'category' => $faker->word, 'date' => $faker->date(), 'status' => '1', 'sponsor' => $faker->name, 'group_id' => $faker->randomElement($groupIds), 'folder_id' => $faker->randomElement($folderIds), 'description' => $faker->paragraph(), 'chatroom_id' => $index]);
}
}
示例14: editProfile
public function editProfile($id)
{
$user = User::findOrFail($id);
$group = Group::lists('name', 'id');
return view('admin.editProfile', compact('user', 'group'));
}
示例15: findGroup
/**
* list all groups
*
* @return [type] [description]
*/
public function findGroup()
{
return Group::lists('name', 'id');
}