Пример #1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(\Request $request)
 {
     if ($request::isMethod('post')) {
         $validator = Validator::make(Input::all(), Group::$groupUpdateRules);
         //if ($validator->passes()) { @TODO fix this to accept array in Group::$groupUpdateRules
         if ($validator->passes()) {
             if (Group::updateGroups($request)) {
                 return Redirect::to('/groups')->with('message', 'The following errors occurred')->withErrors('Update success')->with('flag', 'success');
             }
             return Redirect::to('/groups')->with('message', 'The following errors occurred')->withErrors('Update failed')->with('flag', 'danger');
         }
         return Redirect::to('/groups')->with('message', 'The following errors occurred')->withErrors($validator)->withInput()->with('flag', 'danger');
     }
     $data = Group::paginate(25);
     return view('groups/all', compact('data'));
 }
 public function showAllGroups()
 {
     $groups = Group::paginate(10);
     return view('admin.groups.index', compact('groups'));
 }
Пример #3
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $groups = Group::paginate();
     return view('admin.groups.index', compact('groups'));
 }
Пример #4
0
 /**
  * Created By Dara on 21/12/2015
  * admin-group management
  */
 public function adminIndex($user = null)
 {
     if ($user == null) {
         //no user selected
         $groups = Group::paginate(20);
     } else {
         $groups = $user->groupis()->paginate(20);
     }
     return view('admin.group.index', compact('groups', 'user'))->with(['title' => 'User group Management']);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $groups = Group::paginate($request->input('perpage', 15));
     return view('groups', compact('groups'));
 }