/** * Show the form for creating a new resource. * * @return Response */ public function create(General $general, Request $request) { $theme = $general->theme(); $menu = Menu::find($request['menu']); $menus = null; if (!$menu) { $menus = Menu::all()->lists('name_en', 'id'); } $content = new Content(); $types = ['0' => '---']; foreach (ContentType::all()->lists('name', 'id') as $key => $value) { array_push($types, $value); } $theme['title'] = 'Create Content'; $theme['description'] = 'description for content creation'; $button_text = 'Create Content'; return view('admin.content.create', compact('theme', 'menu', 'menus', 'content', 'types', 'button_text')); }
public function index(Request $request) { $this->layout = 'content.index'; $this->metas['title'] = "Агуулгын удирдлага"; $this->view = $this->BuildLayout(); $contentTypes = ContentType::all(); $categories = Category::getCategoryOptions('2'); return $this->view->withCategories(Category::getCategoryOptions(2))->withContentTypeOptions(ContentType::getContentTypeOptions())->withContents($this->getContents($request)); }