/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(\Request $request) { if ($request::isMethod('post')) { $validator = Validator::make(Input::all(), Organization::$groupUpdateRules); //if ($validator->passes()) { @TODO fix this to accept array in Group::$groupUpdateRules if ($validator->passes()) { if (Organization::updateGroups($request)) { return Redirect::to('/organizations')->with('message', 'The following errors occurred')->withErrors('Update success')->with('flag', 'success'); } return Redirect::to('/organizations')->with('message', 'The following errors occurred')->withErrors('Update failed')->with('flag', 'danger'); } return Redirect::to('/organizations')->with('message', 'The following errors occurred')->withErrors($validator)->withInput()->with('flag', 'danger'); } $data = Organization::paginate(25); return view('organizations/all', compact('data')); }
public function indexOrganization() { $organizations = Organization::paginate(10); return view('admin.indexOrganization', compact('organizations')); }