当前位置: 首页>>代码示例>>PHP>>正文


PHP Group::all方法代码示例

本文整理汇总了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'));
 }
开发者ID:nayed,项目名称:Project-007,代码行数:13,代码来源:UserController.php

示例2: ajax

 public function ajax()
 {
     //
     $data['groups'] = Group::all();
     $data['groups']->load('manager');
     return $data;
 }
开发者ID:machiidev,项目名称:chli,代码行数:7,代码来源:GroupController.php

示例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]);
 }
开发者ID:Jessehuze,项目名称:se-group8,代码行数:28,代码来源:PagesController.php

示例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;
 }
开发者ID:phanngoc,项目名称:internal-tool,代码行数:10,代码来源:GroupControllerTest.php

示例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);
 }
开发者ID:strikles,项目名称:php,代码行数:8,代码来源:AdminGroupsController.php

示例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]);
 }
开发者ID:Pwelling,项目名称:laravelCms,代码行数:9,代码来源:PageController.php

示例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'));
 }
开发者ID:ronal2do,项目名称:Laravel-CMS,代码行数:14,代码来源:GroupController.php

示例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);
     }
 }
开发者ID:pinnaclesoftware,项目名称:Work-Tracking-System,代码行数:10,代码来源:UserController.php

示例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;
 }
开发者ID:scify,项目名称:Vote-collector,代码行数:11,代码来源:Voting.php

示例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;
 }
开发者ID:rhofma,项目名称:rhofma.de,代码行数:13,代码来源:PostService.php

示例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();
 }
开发者ID:kayrules,项目名称:laravel5-starter,代码行数:14,代码来源:UserController.php

示例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);
 }
开发者ID:bstapleton,项目名称:pi-community,代码行数:21,代码来源:UserController.php

示例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();
 }
开发者ID:macewanCS,项目名称:lackingllamas,代码行数:15,代码来源:PDFController.php

示例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'));
 }
开发者ID:macewanCS,项目名称:lackingllamas,代码行数:16,代码来源:GroupController.php

示例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);
                 }
             }
         }
     }
 }
开发者ID:philippejadin,项目名称:Mobilizator,代码行数:22,代码来源:ConvertFiles.php


注:本文中的app\Group::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。