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