/** * 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 create($id = null) { $this->layout = 'content.create'; $this->metas['title'] = "Агуулга нэмэх"; if ($id != null) { $this->metas['title'] = "Агуулга засах"; } $this->appendScriptStyle(); $this->view = $this->BuildLayout(); $this->view->withUser($this->user)->withCategories(Category::getCategoryOptions(2))->withContentTypeOptions(ContentType::getContentTypeOptions()); if ($id != null) { $content = Content::find($id); $this->view->withContent($content); } return $this->view; }
public function run() { DB::table('content_types')->delete(); ContentType::create(['name' => 'Static']); ContentType::create(['name' => 'Dynamic']); ContentType::create(['name' => 'URL']); }