本文整理汇总了PHP中app\Group::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP Group::paginate方法的具体用法?PHP Group::paginate怎么用?PHP Group::paginate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Group
的用法示例。
在下文中一共展示了Group::paginate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* 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'));
}
示例2: showAllGroups
public function showAllGroups()
{
$groups = Group::paginate(10);
return view('admin.groups.index', compact('groups'));
}
示例3: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$groups = Group::paginate();
return view('admin.groups.index', compact('groups'));
}
示例4: adminIndex
/**
* 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']);
}
示例5: index
/**
* 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'));
}