/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $contentMenu = ['content' => 'active open']; $page = Page::findOrFail($id); $category = Content_category::where('type', '=', 'page')->orderBy('id')->pluck('title', 'id'); $users_editor = User::orderBy('name')->pluck('name', 'id'); //return view('backend.pages.edit')->with('page',$page); return view('backend.pages.edit', compact('page', 'category', 'users_editor', 'contentMenu')); }
/** * stranka - show in frontend * @param string $id -id Post * @return Response */ public function catslug($catSlug) { //$page = Page::findOrFail($id); $contentID = Content_category::where('slug', '=', $catSlug)->first(); $slugID = $contentID->id; $categoryName = $contentID->title; $pagesBySlugID = Page::where('content_category_id', '=', $slugID)->where('status', '=', 'open')->get(); return view('frontend.categoryAll', compact('pagesBySlugID', 'categoryName')); }