コード例 #1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $user = User::findOrFail($id);
     $groups = Group::get()->lists('name', 'id');
     $userGroups = $user->groups->lists('id');
     return view('user.edit', compact('user', 'groups', 'userGroups'));
 }
コード例 #2
0
 public function getGroups()
 {
     $user = Auth::user();
     $files = array();
     if ($user->is('admin')) {
         $groups = Group::get();
     } else {
         if ($user->is('groupadmin')) {
             $groups = [Group::find($user->group_id)];
         }
     }
     foreach ($groups as $group) {
         $files[$group->name] = Cloud::getContents($group->name, true);
     }
     $data['groups'] = $groups;
     $data['files'] = $files;
     return Theme::view('admin.groups', $data);
 }