コード例 #1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create(General $general, User $user)
 {
     $theme = $general->theme();
     $registration_links = RegistrationLink::valid()->get();
     $groups = Group::orderBy('role_id')->lists('name', 'id');
     $theme['title'] = 'Create User';
     $theme['description'] = 'Here you generate link which will be used by another user for sign up';
     $button_text = 'Generate User Register Link';
     return view('admin.user.create', compact('theme', 'user', 'registration_links', 'groups', 'button_text'));
 }
コード例 #2
0
 /**
  * Main HOMEPAGE
  *
  * @return Response
  */
 public function index(Request $request)
 {
     if (Auth::check()) {
         $groups = \App\Group::with('membership')->orderBy('name')->paginate(50);
         $my_groups = Auth::user()->groups()->orderBy('name')->get();
         $my_groups_id = false;
         // using this array we can adjust the queries after to only include stuff the user has
         // might be a good idea to find a clever way to build this array of groups id :
         foreach ($my_groups as $the_group) {
             $my_groups_id[] = $the_group->id;
         }
         $my_discussions = \App\Discussion::with('userReadDiscussion', 'user', 'group')->whereIn('group_id', $my_groups_id)->orderBy('updated_at', 'desc')->paginate(10);
         $my_actions = \App\Action::with('user', 'group')->whereIn('group_id', $my_groups_id)->where('start', '>=', Carbon::now())->orderBy('start', 'asc')->paginate(10);
         $other_discussions = \App\Discussion::with('userReadDiscussion', 'user', 'group')->whereNotIn('group_id', $my_groups_id)->orderBy('updated_at', 'desc')->paginate(10);
         $other_actions = \App\Action::with('user', 'group')->whereNotIn('group_id', $my_groups_id)->where('start', '>=', Carbon::now())->orderBy('start', 'asc')->paginate(10);
         return view('dashboard.homepage')->with('groups', $groups)->with('my_groups', $my_groups)->with('my_discussions', $my_discussions)->with('my_actions', $my_actions)->with('other_actions', $other_actions)->with('other_discussions', $other_discussions);
     } else {
         $groups = \App\Group::orderBy('name')->paginate(50);
         $other_discussions = \App\Discussion::with('user', 'group')->orderBy('updated_at', 'desc')->paginate(10);
         $other_actions = \App\Action::with('user', 'group')->where('start', '>=', Carbon::now())->orderBy('start', 'asc')->paginate(10);
         $my_groups = false;
         return view('dashboard.homepage')->with('groups', $groups)->with('my_groups', $my_groups)->with('other_discussions', $other_discussions)->with('other_actions', $other_actions);
     }
 }
コード例 #3
0
ファイル: GroupsController.php プロジェクト: vespan/grupr
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $groups = Group::orderBy('name')->get();
     return view('groups.index', compact('groups'));
 }
コード例 #4
0
 protected function leagueData()
 {
     $committees = Committee::where('active', 1)->orderBy('name')->get();
     $positions = Position::all();
     $requirements = $this->currentYearBaseReqs();
     $teams = Team::where('active', 1)->orderBy('name')->get();
     $groups = Group::orderBy('name')->get();
     $roles = Role::orderBy('name')->get();
     return array('committees' => $committees, 'positions' => $positions, 'requirements' => $requirements, 'teams' => $teams, 'groups' => $groups, 'roles' => $roles);
 }