当前位置: 首页>>代码示例>>PHP>>正文


PHP Menu::find方法代码示例

本文整理汇总了PHP中app\Menu::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::find方法的具体用法?PHP Menu::find怎么用?PHP Menu::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Menu的用法示例。


在下文中一共展示了Menu::find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $menu = Menu::find($id);
     $menu->fill($request->all());
     $menu->save();
     Session::flash('message', 'Data Telah di Update');
     return Redirect::to('/menu');
 }
开发者ID:vinnodevega,项目名称:cdc,代码行数:15,代码来源:menuController.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CreateContentRequest $request)
 {
     $this->dispatch(new CreateContentCommand(Auth::user(), $request));
     $menu = Menu::find($request->menu_id);
     if ($menu) {
         return redirect('/admin/menu/' . $menu->id);
     }
     return redirect('/admin/content');
 }
开发者ID:ronal2do,项目名称:Laravel-CMS,代码行数:14,代码来源:ContentController.php

示例3: postQuickUpdate

 public function postQuickUpdate()
 {
     $inputs = Input::all();
     $menu = Menu::find($inputs['pk']);
     $menu->{$inputs}['name'] = $inputs['value'];
     Log::info("menu save" . $menu->id . " " . $menu->name);
     $menu->save();
     return "test";
 }
开发者ID:rstuemer,项目名称:homeauto,代码行数:9,代码来源:MenusController.php

示例4: editDish

 public function editDish($mid)
 {
     // Get menu infor
     $menu = Menu::find($mid)->get();
     // Get menu-sub infor
     $menuItem = MenuItem::where('mid', '=', $mid)->get();
     $viewArr = ['menu' => $menu->toArray()[0], 'imenu' => $menuItem->toArray()];
     return view("teabreak/menu/editDish", $viewArr);
 }
开发者ID:khoale193,项目名称:lavarel,代码行数:9,代码来源:MenuController.php

示例5: update

 public function update()
 {
     $input = Request::all();
     $menu = Menu::find($input['_id']);
     $menu->menu = $input['menu_nombre'];
     $menu->url = $input['menu_url'];
     $menu->padre_id = $input['menu_padre_id'];
     $menu->save();
     return view('menu.verMenu')->with('menu', $menu)->with('edited', true);
 }
开发者ID:guiles00,项目名称:acfj,代码行数:10,代码来源:MenuController.php

示例6: editMenu

 public function editMenu()
 {
     $id = (int) Input::get('id');
     $menu = Menu::find($id);
     if ($menu->exists()) {
         $menu->title = ucwords(Input::get('val'));
         $menu->save();
     }
     return 1;
 }
开发者ID:nitin-prodigi,项目名称:mesa,代码行数:10,代码来源:MenuController.php

示例7: update

 public function update(array $data, $id)
 {
     $menu = Menu::find($id);
     $menu->fid = $data['fid'];
     $menu->name = $data['name'];
     $menu->route_name = $data['route_name'];
     $menu->icon = $data['icon'];
     $menu->save();
     return $menu;
 }
开发者ID:nutsdo,项目名称:mz-service,代码行数:10,代码来源:MenuRepository.php

示例8: order

 public function order($id, $orderBy, $no)
 {
     // Actualizamos el registro con id
     $flag = 1;
     $this->setOrderItem($flag, $orderBy, $no);
     $menu = \App\Menu::find($id);
     $menu->order_by = $no;
     $menu->save();
     Session::flash('message', 'Ordén del Albúm actualizado');
     return redirect('/admin/menus');
 }
开发者ID:gitsolution,项目名称:blog,代码行数:11,代码来源:MenuController.php

示例9: search

 public function search(Request $request)
 {
     $menu = \App\Menu::find(1);
     $search = $request->input('search') ?: '';
     /*$categories = \App\Category::where('level','1')->orderBy('ordering')->get();
       $parentCategory = \App\Category::where('title','like','%'.$search.'%')
                                      ->orWhereIn('parent_id',DB::table('categories')->where('title',$search)->lists('id'))
                                      ->lists('id');*/
     $categories = \App\Category::whereNull('deleted_at')->get();
     $contents = \App\Content::where('title', 'like', '%' . $search . '%')->whereNull('deleted_at')->orderBy('created_at')->paginate(21);
     return view('project_list')->with(['category' => '', 'categories' => $categories, 'contents' => $contents, 'menu' => $menu]);
 }
开发者ID:TEACHER-KEAK,项目名称:GAD,代码行数:12,代码来源:CategoryController.php

示例10: 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);
     }
 }
开发者ID:nitin-prodigi,项目名称:mesa,代码行数:17,代码来源:IndexController.php

示例11: 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);
 }
开发者ID:nitin-prodigi,项目名称:mesa,代码行数:17,代码来源:ArticleController.php

示例12: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $menu = Menu::find($id);
     $menu->delete();
     return response()->json(['STATUS' => true]);
 }
开发者ID:TEACHER-KEAK,项目名称:GAD,代码行数:12,代码来源:MenuController.php

示例13: delete

 /**
  * Delete menu
  * @param $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function delete($id)
 {
     Menu::find($id)->delete();
     return redirect('admin/menus');
 }
开发者ID:jbs321,项目名称:profiler,代码行数:10,代码来源:MenuController.php

示例14: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $menu = Menu::find($id);
     $menu->delete();
     return Redirect::to('/menu');
 }
开发者ID:pramitafirnanda,项目名称:cdc,代码行数:12,代码来源:menuController.php

示例15: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $menu = Menu::find($id);
     return view('menu.edit', ['menu' => $menu]);
 }
开发者ID:muschottkey,项目名称:bausbaus,代码行数:11,代码来源:MenuController.php


注:本文中的app\Menu::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。