本文整理汇总了PHP中app\Group::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Group::all方法的具体用法?PHP Group::all怎么用?PHP Group::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Group
的用法示例。
在下文中一共展示了Group::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$user = User::findOrFail($id);
$groups = Group::all(['id', 'name']);
$categories = Category::all(['id', 'name']);
return view('users.edit', compact('user', 'groups', 'categories'));
}
示例2: ajax
public function ajax()
{
//
$data['groups'] = Group::all();
$data['groups']->load('manager');
return $data;
}
示例3: dashboard
public function dashboard()
{
$user = Auth::user();
//Functional ORM Code For Grabbing Data From Database
if (Auth::check()) {
$routes = $user->routes()->get();
$groups = Group::all();
$users = User::all();
$friends = $user->friends()->get();
$userGroups = $user->groups()->get();
$ownedGroups = $user->ownedGroups()->get();
$ownedRoutes = $user->ownedRoutes()->get();
$friendIds = array();
foreach ($friends as $friend) {
array_push($friendIds, $friend->id);
}
$groupIds = array();
foreach ($userGroups as $group) {
array_push($groupIds, $group->id);
}
} else {
$routes = $groups = $users = $friends = null;
$ownedGroups = $ownedRoutes = $friendIds = null;
$groupIds = null;
}
// This will route and pass data to the dashboard view
return view('pages.dashboard', ['user' => $user, 'users' => $users, 'routes' => $routes, 'groups' => $groups, 'friends' => $friends, 'friendIds' => $friendIds, 'groupIds' => $groupIds, 'ownedGroups' => $ownedGroups, 'ownedRoutes' => $ownedRoutes]);
}
示例4: setUp
/**
* set up start
*/
public function setUp()
{
parent::setUp();
Session::start();
// $this->mock = \Mockery::mock('\App\Group');
$this->id_test = Group::all()->first()->id;
}
示例5: delete
public function delete($group)
{
$group->delete();
$all_groups = \App\Group::all();
$title = 'Groups';
$html = view('admin.groups.table', compact('title', 'all_groups'))->render();
return Admin::view($html);
}
示例6: listPages
function listPages()
{
$groups = Group::all();
foreach ($groups as $key => $group) {
$pages = Group::find($group->id)->getPages;
$groups[$key]['pages'] = $pages;
}
return view('pages', ['groups' => $groups]);
}
示例7: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(General $general)
{
$theme = $general->theme();
$groups = Group::all();
$count = 1;
$theme['title'] = 'Groups';
$theme['description'] = 'description for groups menu';
return view('admin.group.index', compact('theme', 'groups', 'count'));
}
示例8: create
public function create()
{
if ($this->currentUser->hasAccess('wts.user.create')) {
$groups = Group::all();
$data = ['page_title' => 'Yeni Kullanıcı', 'model' => 'users', 'menu' => 'users', 'groups' => $groups, 'page_description' => 'Sisteme Yeni Bir Kullanıcı Ekleme Sayfasıdır'];
return view('admin.user-group.user.create', $data);
} else {
abort(403, $this->accessForbidden);
}
}
示例9: defaultVotesSet
public function defaultVotesSet()
{
// check that the count of GroupVotes with this voting's id is equal to the count of all groups * number of voting items of this voting
$groupCount = Group::all()->count();
$votingItemCount = VotingItem::ofVoting($this->id)->count();
$correctAmount = $groupCount * $votingItemCount;
if (GroupVote::ofVoting($this->id)->count() == $correctAmount) {
return true;
}
return false;
}
示例10: getGroupList
public function getGroupList($groupId = 0)
{
$groups = Group::all();
$list = [];
foreach ($groups as $group) {
$selected = '';
if ($group->id == $groupId) {
$selected = ' selected';
}
$list[] = ['id' => $group->id, 'text' => $group->name, 'selected' => $selected];
}
return $list;
}
示例11: GET_updateUserForm
public function GET_updateUserForm($id)
{
$theme = Theme::uses('notebook')->layout('default');
$theme->setMenu('user.user');
$user = User::find($id);
$ugroups = $user->getGroups();
$user_groups = array();
foreach ($ugroups as $key => $usergrp) {
$user_groups[$usergrp->id] = $usergrp->name;
}
$groups = Group::all();
$params = array('user' => $user, 'groups' => $groups, 'user_groups' => $user_groups);
return $theme->scope('user.update', $params)->render();
}
示例12: edit
/**
* Returns a view for editing various details about a specific user
*
* @param $name Node 'name' label to match when editing a user
* @return $this
*/
public function edit($name)
{
$user = User::whereName($name)->first();
$groups = Group::all(['id', 'name']);
$groupList = array();
foreach ($groups as $group) {
$groupList[$group->id] = $group->name;
}
$countries = Country::all(['id', 'name']);
$countryList = array();
foreach ($countries as $country) {
$countryList[$country->id] = $country->name;
}
return view('admin.users.edit', compact('user'))->with('groupList', $groupList)->with('countryList', $countryList);
}
示例13: show
public function show()
{
$bp = BusinessPlan::all();
$idbp = count($bp);
$bpPlans = DB::select("select * from (select null as userId, null as progress, null as date, null as successMeasured, null as budget, null as collaborators, goals.group, goals. id, null as description, goals.name, goals.ident from goals ,business_plans where business_plans.id = goals.bpid and business_plans.id = '" . $idbp . "' union all select null as userId, null as progress, null as date, null as successMeasured, null as budget, null as collaborators, objectives.group, objectives.id, null as description, objectives.name, objectives.ident from objectives, goals, business_plans where goals.id = objectives.goal_id and business_plans.id = goals.bpid and business_plans.id = '" . $idbp . "' union all select actions.userId, actions.progress, actions.date, actions.successMeasured, actions.budget, actions.collaborators, actions.group, actions.id, actions.description, null as name, actions.ident from actions, objectives, goals, business_plans where objectives.id = actions.objective_id and goals.id = objectives.goal_id and business_plans.id = goals.bpid and business_plans.id = '" . $idbp . "' union all select tasks.userId, tasks.progress, tasks.date, tasks.successMeasured, tasks.budget, tasks.collaborators, tasks.group, tasks.id, tasks.description, null as name, tasks.ident from tasks, actions, objectives, goals, business_plans where actions.id = tasks.action_id and objectives.id = actions.objective_id and goals.id = objectives.goal_id and business_plans.id = goals.bpid and business_plans.id = '" . $idbp . "')a order by ident");
$users = User::all();
$groups = Group::all();
$filters = null;
$nameBP = $bp[$idbp - 1]->name;
//$users[$bp->userId - 1]->name
$html = View::make('businessPlan.printBP', compact('users', 'groups', 'bpPlans', 'idbp', 'filters', 'nameBP'))->render();
$pdf = App::make('dompdf.wrapper');
$pdf->loadHTML($html);
return $pdf->stream();
}
示例14: groups
public function groups()
{
$bp = BusinessPlan::all();
$bpid = count($bp);
$groups = Group::all();
$tasks = array();
$actions = array();
foreach (BusinessPlan::all() as $x) {
array_push($tasks, DB::select("select t.* from tasks t, actions a, objectives o, goals g, business_plans b where t.action_id = a.id and a.objective_id = o.id and o.goal_id = g.id and g.bpid = b.id and b.id = {$x->id}"));
array_push($actions, DB::select("select a.* from actions a, objectives o, goals g, business_plans b where a.objective_id = o.id and o.goal_id = g.id and g.bpid = b.id and b.id = {$x->id}"));
}
$users = User::all();
$rosters = Roster::all();
$businessPlans = BusinessPlan::lists('name', 'id');
return view('groups', compact('groups', 'actions', 'tasks', 'users', 'rosters', 'businessPlans', 'bpid'));
}
示例15: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
foreach (\App\Group::all() as $group) {
$this->info('Checking if there is something to convert for group ' . $group->name . ' (' . $group->id . ')');
foreach ($group->files as $file) {
if ($file->isFile()) {
if (Storage::disk('local')->has($file->path)) {
$source = Storage::disk('local')->get($file->path);
Storage::disk('public')->put('groups/' . $group->id . '/' . $file->name, $source);
$this->info('Copied file ' . $file->name);
} else {
$this->info('File not found ' . $file->name);
}
}
}
}
}