本文整理汇总了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');
}
示例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');
}
示例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";
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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');
}
示例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]);
}
示例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);
}
}
示例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);
}
示例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]);
}
示例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');
}
示例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');
}
示例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]);
}