本文整理汇总了PHP中app\Menu::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::orderBy方法的具体用法?PHP Menu::orderBy怎么用?PHP Menu::orderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Menu
的用法示例。
在下文中一共展示了Menu::orderBy方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$package_rule = PackageRule::findOrFail($id);
$menus = Menu::orderBy('name')->notMainCourse()->lists('name', 'id');
$package = $package_rule->package()->first();
return view('admin.packages.modals.package_rules._edit_package_rule', compact('package_rule', 'package', 'menus'));
}
示例2: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$allmenus = Menu::orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
$menus = $this->clubarr($allmenus);
//\Mesa::prr($menus);
return view('admin.menu.index')->withMenus($menus)->withPage('menu');
}
示例3: showAgenda
public function showAgenda($slug)
{
$data['menuse'] = Menu::orderBy('id')->get()->keyBy('id');
$data['agenda5'] = Agenda::orderBy('id', 'desc')->take(4)->get();
$data['footers'] = Footer::orderBy('id')->get()->keyBy('id');
$data['post'] = Agenda::where('slug', '=', $slug)->firstOrFail();
return view('agenda.showAgenda')->with('data', $data);
}
示例4: edit
/**
* Show the package edit form.
*
* @param $id
* @return \Illuminate\View\View
*/
public function edit($id)
{
$package = Package::findOrFail($id);
$package_courses = $package->courses()->get();
$package_rules = $package->rules()->get();
$menus = Menu::orderBy('name')->where('is_main_course', 0)->lists('name', 'id');
if (!$menus->count()) {
$menus->put(0, 'No Menus found.');
}
return view('admin.packages.edit', compact('package', 'package_courses', 'package_rules', 'menus'));
}
示例5: topicAction
public function topicAction()
{
$topic_id = (int) Input::get('id', 0);
$currtopic = Topic::find($topic_id);
if ($currtopic->exists()) {
$menu_id = $currtopic->menu_id;
$topicarr = Menu::find($menu_id)->topics()->orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
$topics = $this->clubarr($topicarr);
$childtopics = $this->findTopics($topics, $topic_id);
$allmenus = Menu::orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
$menus = $this->clubarr($allmenus);
$articles = Menu::find($menu_id)->articles()->join('article_contents', 'article_contents.article_id', '=', 'articles.id')->whereIn('articles.topic_id', $childtopics)->get(['articles.*', 'article_contents.title'])->toArray();
$viewarr = array('articles' => $articles, 'menus' => $menus, 'menuid' => $menu_id, 'topics' => $topics, 'topicid' => $topic_id);
\View::share('pagetitle', $currtopic->title);
return view('civil.menulist')->with($viewarr);
}
}
示例6: indexAction
public function indexAction()
{
$art_id = (int) Input::get('id', 0);
if ($art_id) {
$article = Article::find($art_id);
} else {
$article = Article::take(1)->skip(0);
}
$currarticle = $article->join('article_contents', 'article_contents.article_id', '=', 'articles.id')->get(['articles.*', 'article_contents.title', 'article_contents.content'])->first()->toArray();
\Mesa::prr($currarticle, 55);
$topicarr = Menu::find($currarticle['menu_id'])->topics()->orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
$topics = $this->clubarr($topicarr);
$allmenus = Menu::orderBy('level', 'ASC')->orderBy('title', 'ASC')->get()->toArray();
$menus = $this->clubarr($allmenus);
$viewarr = array('article' => $currarticle, 'topics' => $topics, 'menus' => $menus);
return view('civil.article.index')->with($viewarr);
}
示例7: index
/**
* List all the menus
*
* @return \Illuminate\View\View
*/
public function index()
{
$menus = Menu::orderBy('name', 'asc')->get();
return view('admin.menus.index', compact('menus'));
}
示例8: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$menuitem = MenuItem::findOrFail($id);
$menus = Menu::orderBy('name')->lists('name', 'id');
return view('admin.menuitems.edit', compact('menuitem', 'menus'));
}
示例9: visi
public function visi()
{
$data['menuse'] = Menu::orderBy('id')->get()->keyBy('id');
$data['agenda5'] = Agenda::orderBy('id', 'desc')->take(4)->get();
$data['footers'] = Footer::orderBy('id')->get()->keyBy('id');
$data['berita-footer'] = Berita::orderBy('id', 'desc')->take(9)->get();
$data['tentang-unit'] = AdminTentang::orderBy('id')->get()->keyBy('id');
return view('visi')->with('data', $data);
}
示例10: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$elements = Menu::orderBy('id', 'desc')->get();
return view('admin.admin')->with('elements', $elements);
}